diff -Nru libgit2-0.22.2/appveyor.yml libgit2-0.23.1/appveyor.yml --- libgit2-0.22.2/appveyor.yml 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/appveyor.yml 2015-08-03 18:07:35.000000000 +0000 @@ -2,18 +2,38 @@ branches: only: - master -build_script: -- ps: >- - choco install cmake - - choco install python2 + - /^maint.*/ +environment: + GITTEST_INVASIVE_FS_STRUCTURE: 1 + GITTEST_INVASIVE_FS_SIZE: 1 + matrix: + - GENERATOR: "Visual Studio 11" + ARCH: 32 + - GENERATOR: "Visual Studio 11 Win64" + ARCH: 64 + - GENERATOR: "MSYS Makefiles" + ARCH: 32 + - GENERATOR: "MSYS Makefiles" + ARCH: i686 # this is for 32-bit MinGW-w64 + - GENERATOR: "MSYS Makefiles" + ARCH: 64 +matrix: + allow_failures: + - GENERATOR: "MSYS Makefiles" + ARCH: 32 +cache: +- i686-4.9.2-release-win32-sjlj-rt_v3-rev1.7z +- x86_64-4.9.2-release-win32-seh-rt_v3-rev1.7z +build_script: +- ps: | mkdir build - cd build - - cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON -D STDCALL=ON .. -G"Visual Studio 11" - - cmake --build . --config RelWithDebInfo + if ($env:GENERATOR -ne "MSYS Makefiles") { + cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON -D MSVC_CRTDBG=ON .. -G"$env:GENERATOR" + cmake --build . --config Debug + } +- cmd: | + if "%GENERATOR%"=="MSYS Makefiles" (C:\MinGW\msys\1.0\bin\sh --login /c/projects/libgit2/script/appveyor-mingw.sh) test_script: - ps: ctest -V . diff -Nru libgit2-0.22.2/AUTHORS libgit2-0.23.1/AUTHORS --- libgit2-0.22.2/AUTHORS 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/AUTHORS 2015-08-03 18:07:35.000000000 +0000 @@ -49,6 +49,7 @@ Olivier Ramonat Peter Drahoš Pierre Habouzit +Pierre-Olivier Latour Przemyslaw Pawelczyk Ramsay Jones Robert G. Jakabosky diff -Nru libgit2-0.22.2/CHANGELOG.md libgit2-0.23.1/CHANGELOG.md --- libgit2-0.22.2/CHANGELOG.md 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/CHANGELOG.md 2015-08-03 18:07:35.000000000 +0000 @@ -1,6 +1,311 @@ -v0.22 + 1 +v0.23 + 1 +------- + +### Changes or improvements + +### API additions + +### API removals + +v0.23 ------ +### Changes or improvements + +* Patience and minimal diff drivers can now be used for merges. + +* Merges can now ignore whitespace changes. + +* Updated binary identification in CRLF filtering to avoid false positives in + UTF-8 files. + +* Rename and copy detection is enabled for small files. + +* Checkout can now handle an initial checkout of a repository, making + `GIT_CHECKOUT_SAFE_CREATE` unnecessary for users of clone. + +* The signature parameter in the ref-modifying functions has been + removed. Use `git_repository_set_ident()` and + `git_repository_ident()` to override the signature to be used. + +* The local transport now auto-scales the number of threads to use + when creating the packfile instead of sticking to one. + +* Reference renaming now uses the right id for the old value. + +* The annotated version of branch creation, HEAD detaching and reset + allow for specifying the expression from the user to be put into the + reflog. + +* `git_rebase_commit` now returns `GIT_EUNMERGED` when you attempt to + commit with unstaged changes. + +* On Mac OS X, we now use SecureTransport to provide the cryptographic + support for HTTPS connections insead of OpenSSL. + +* Checkout can now accept an index for the baseline computations via the + `baseline_index` member. + +* The configuration for fetching is no longer stored inside the + `git_remote` struct but has been moved to a `git_fetch_options`. The + remote functions now take these options or the callbacks instead of + setting them beforehand. + +* `git_submodule` instances are no longer cached or shared across + lookup. Each submodule represents the configuration at the time of + loading. + +* The index now uses diffs for `add_all()` and `update_all()` which + gives it a speed boost and closer semantics to git. + +* The ssh transport now reports the stderr output from the server as + the error message, which allows you to get the "repository not + found" messages. + +* `git_index_conflict_add()` will remove staged entries that exist for + conflicted paths. + +* The flags for a `git_diff_file` will now have the `GIT_DIFF_FLAG_EXISTS` + bit set when a file exists on that side of the diff. This is useful + for understanding whether a side of the diff exists in the presence of + a conflict. + +* The constructor for a write-stream into the odb now takes + `git_off_t` instead of `size_t` for the size of the blob, which + allows putting large files into the odb on 32-bit systems. + +* The remote's push and pull URLs now honor the url.$URL.insteadOf + configuration. This allows modifying URL prefixes to a custom + value via gitconfig. + +* `git_diff_foreach`, `git_diff_blobs`, `git_diff_blob_to_buffer`, + and `git_diff_buffers` now accept a new binary callback of type + `git_diff_binary_cb` that includes the binary diff information. + +* The race condition mitigations described in `racy-git.txt` have been + implemented. + +* If libcurl is installed, we will use it to connect to HTTP(S) + servers. + +### API additions + +* The `git_merge_options` gained a `file_flags` member. + +* Parsing and retrieving a configuration value as a path is exposed + via `git_config_parse_path()` and `git_config_get_path()` + respectively. + +* `git_repository_set_ident()` and `git_repository_ident()` serve to + set and query which identity will be used when writing to the + reflog. + +* `git_config_entry_free()` frees a config entry. + +* `git_config_get_string_buf()` provides a way to safely retrieve a + string from a non-snapshot configuration. + +* `git_annotated_commit_from_revspec()` allows to get an annotated + commit from an extended sha synatx string. + +* `git_repository_set_head_detached_from_annotated()`, + `git_branch_create_from_annotated()` and + `git_reset_from_annotated()` allow for the caller to provide an + annotated commit through which they can control what expression is + put into the reflog as the source/target. + +* `git_index_add_frombuffer()` can now create a blob from memory + buffer and add it to the index which is attached to a repository. + +* The structure `git_fetch_options` has been added to determine the + runtime configuration for fetching, such as callbacks, pruning and + autotag behaviour. It has the runtime initializer + `git_fetch_init_options()`. + +* The enum `git_fetch_prune_t` has been added, letting you specify the + pruning behaviour for a fetch. + +* A push operation will notify the caller of what updates it indends + to perform on the remote, which provides similar information to + git's pre-push hook. + +* `git_stash_apply()` can now apply a stashed state from the stash list, + placing the data into the working directory and index. + +* `git_stash_pop()` will apply a stashed state (like `git_stash_apply()`) + but will remove the stashed state after a successful application. + +* A new error code `GIT_EEOF` indicates an early EOF from the + server. This typically indicates an error with the URL or + configuration of the server, and tools can use this to show messages + about failing to communicate with the server. + +* A new error code `GIT_EINVALID` indicates that an argument to a + function is invalid, or an invalid operation was requested. + +* `git_diff_index_to_workdir()` and `git_diff_tree_to_index()` will now + produce deltas of type `GIT_DELTA_CONFLICTED` to indicate that the index + side of the delta is a conflict. + +* The `git_status` family of functions will now produce status of type + `GIT_STATUS_CONFLICTED` to indicate that a conflict exists for that file + in the index. + +* `git_index_entry_is_conflict()` is a utility function to determine if + a given index entry has a non-zero stage entry, indicating that it is + one side of a conflict. + +* It is now possible to pass a keypair via a buffer instead of a + path. For this, `GIT_CREDTYPE_SSH_MEMORY` and + `git_cred_ssh_key_memory_new()` have been added. + +* `git_filter_list_contains` will indicate whether a particular + filter will be run in the given filter list. + +* `git_commit_header_field()` has been added, which allows retrieving + the contents of an arbitrary header field. + +* `git_submodule_set_branch()` allows to set the configured branch for + a submodule. + +### API removals + +* `git_remote_save()` and `git_remote_clear_refspecs()` have been + removed. Remote's configuration is changed via the configuration + directly or through a convenience function which performs changes to + the configuration directly. + +* `git_remote_set_callbacks()`, `git_remote_get_callbacks()` and + `git_remote_set_transport()` have been removed and the remote no + longer stores this configuration. + +* `git_remote_set_fetch_refpecs()` and + `git_remote_set_push_refspecs()` have been removed. There is no + longer a way to set the base refspecs at run-time. + +* `git_submodule_save()` has been removed. The submodules are no + longer configured via the objects. + +* `git_submodule_reload_all()` has been removed as we no longer cache + submodules. + +### Breaking API changes + +* `git_smart_subtransport_cb` now has a `param` parameter. + +* The `git_merge_options` structure member `flags` has been renamed + to `tree_flags`. + +* The `git_merge_file_options` structure member `flags` is now + an unsigned int. It was previously a `git_merge_file_flags_t`. + +* `GIT_CHECKOUT_SAFE_CREATE` has been removed. Most users will generally + be able to switch to `GIT_CHECKOUT_SAFE`, but if you require missing + file handling during checkout, you may now use `GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING`. + +* The `git_clone_options` and `git_submodule_update_options` + structures no longer have a `signature` field. + +* The following functions have removed the signature and/or log message + parameters in favour of git-emulating ones. + + * `git_branch_create()`, `git_branch_move()` + * `git_rebase_init()`, `git_rebase_abort()` + * `git_reference_symbolic_create_matching()`, + `git_reference_symbolic_create()`, `git_reference_create()`, + `git_reference_create_matching()`, + `git_reference_symbolic_set_target()`, + `git_reference_set_target()`, `git_reference_rename()` + * `git_remote_update_tips()`, `git_remote_fetch()`, `git_remote_push()` + * `git_repository_set_head()`, + `git_repository_set_head_detached()`, + `git_repository_detach_head()` + * `git_reset()` + +* `git_config_get_entry()` now gives back a ref-counted + `git_config_entry`. You must free it when you no longer need it. + +* `git_config_get_string()` will return an error if used on a + non-snapshot configuration, as there can be no guarantee that the + returned pointer is valid. + +* `git_note_default_ref()` now uses a `git_buf` to return the string, + as the string is otherwise not guaranteed to stay allocated. + +* `git_rebase_operation_current()` will return `GIT_REBASE_NO_OPERATION` + if it is called immediately after creating a rebase session but before + you have applied the first patch. + +* `git_rebase_options` now contains a `git_checkout_options` struct + that will be used for functions that modify the working directory, + namely `git_checkout_init`, `git_checkout_next` and + `git_checkout_abort`. As a result, `git_rebase_open` now also takes + a `git_rebase_options` and only the `git_rebase_init` and + `git_rebase_open` functions take a `git_rebase_options`, where they + will persist the options to subsequent `git_rebase` calls. + +* The `git_clone_options` struct now has fetch options in a + `fetch_opts` field instead of remote callbacks in + `remote_callbacks`. + +* The remote callbacks has gained a new member `push_negotiation` + which gets called before sending the update commands to the server. + +* The following functions no longer act on a remote instance but + change the repository's configuration. Their signatures have changed + accordingly: + + * `git_remote_set_url()`, `git_remote_seturl()` + * `git_remote_add_fetch()`, `git_remote_add_push()` and + * `git_remote_set_autotag()` + +* `git_remote_connect()` and `git_remote_prune()` now take a pointer + to the callbacks. + +* `git_remote_fetch()` and `git_remote_download()` now take a pointer + to fetch options which determine the runtime configuration. + +* The `git_remote_autotag_option_t` values have been changed. It has + gained a `_UNSPECIFIED` default value to specify no override for the + configured setting. + +* `git_remote_update_tips()` now takes a pointer to the callbacks as + well as a boolean whether to write `FETCH_HEAD` and the autotag + setting. + +* `git_remote_create_anonymous()` no longer takes a fetch refspec as + url-only remotes cannot have configured refspecs. + +* The `git_submodule_update_options` struct now has fetch options in + the `fetch_opts` field instead of callbacks in the + `remote_callbacks` field. + +* The following functions no longer act on a submodule instance but + change the repository's configuration. Their signatures have changed + accordingly: + + * `git_submodule_set_url()`, `git_submodule_set_ignore()`, + `git_submodule_set_update()`, + `git_submodule_set_fetch_recurse_submodules()`. + +* `git_submodule_status()` no longer takes a submodule instance but a + repsitory, a submodule name and an ignore setting. + +* The `push` function in the `git_transport` interface now takes a + pointer to the remote callbacks. + +* The `git_index_entry` struct's fields' types have been changed to + more accurately reflect what is in fact stored in the + index. Specifically, time and file size are 32 bits intead of 64, as + these values are truncated. + +* `GIT_EMERGECONFLICT` is now `GIT_ECONFLICT`, which more accurately + describes the nature of the error. + +* It is no longer allowed to call `git_buf_grow()` on buffers + borrowing the memory they point to. + v0.22 ------ diff -Nru libgit2-0.22.2/cmake/Modules/FindCoreFoundation.cmake libgit2-0.23.1/cmake/Modules/FindCoreFoundation.cmake --- libgit2-0.22.2/cmake/Modules/FindCoreFoundation.cmake 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/cmake/Modules/FindCoreFoundation.cmake 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,9 @@ +IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS) + SET(COREFOUNDATION_FOUND TRUE) +ELSE () + FIND_PATH(COREFOUNDATION_INCLUDE_DIR NAMES CoreFoundation.h) + FIND_LIBRARY(COREFOUNDATION_DIRS NAMES CoreFoundation) + IF (COREFOUNDATION_INCLUDE_DIR AND COREFOUNDATION_DIRS) + SET(COREFOUNDATION_FOUND TRUE) + ENDIF () +ENDIF () diff -Nru libgit2-0.22.2/cmake/Modules/FindIconv.cmake libgit2-0.23.1/cmake/Modules/FindIconv.cmake --- libgit2-0.22.2/cmake/Modules/FindIconv.cmake 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/cmake/Modules/FindIconv.cmake 2015-08-03 18:07:35.000000000 +0000 @@ -11,10 +11,7 @@ SET(ICONV_FIND_QUIETLY TRUE) ENDIF() -FIND_PATH(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include NO_DEFAULT_PATH) FIND_PATH(ICONV_INCLUDE_DIR iconv.h) - -FIND_LIBRARY(iconv_lib NAMES iconv libiconv libiconv-2 c NO_DEFAULT_PATH PATHS /opt/local/lib) FIND_LIBRARY(iconv_lib NAMES iconv libiconv libiconv-2 c) IF(ICONV_INCLUDE_DIR AND iconv_lib) diff -Nru libgit2-0.22.2/cmake/Modules/FindSecurity.cmake libgit2-0.23.1/cmake/Modules/FindSecurity.cmake --- libgit2-0.22.2/cmake/Modules/FindSecurity.cmake 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/cmake/Modules/FindSecurity.cmake 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,9 @@ +IF (SECURITY_INCLUDE_DIR AND SECURITY_DIRS) + SET(SECURITY_FOUND TRUE) +ELSE () + FIND_PATH(SECURITY_INCLUDE_DIR NAMES Security/Security.h) + FIND_LIBRARY(SECURITY_DIRS NAMES Security) + IF (SECURITY_INCLUDE_DIR AND SECURITY_DIRS) + SET(SECURITY_FOUND TRUE) + ENDIF () +ENDIF () diff -Nru libgit2-0.22.2/CMakeLists.txt libgit2-0.23.1/CMakeLists.txt --- libgit2-0.22.2/CMakeLists.txt 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/CMakeLists.txt 2015-08-03 18:07:35.000000000 +0000 @@ -12,7 +12,8 @@ # > cmake --build . --target install PROJECT(libgit2 C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_POLICY(SET CMP0015 NEW) # Add find modules to the path SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/") @@ -33,15 +34,16 @@ OPTION( ENABLE_TRACE "Enables tracing support" OFF ) OPTION( LIBGIT2_FILENAME "Name of the produced binary" OFF ) -OPTION( ANDROID "Build for android NDK" OFF ) - OPTION( USE_ICONV "Link with and use iconv library" OFF ) OPTION( USE_SSH "Link with libssh to enable SSH support" ON ) OPTION( USE_GSSAPI "Link with libgssapi for SPNEGO auth" OFF ) OPTION( VALGRIND "Configure build for valgrind" OFF ) +OPTION( CURL "User curl for HTTP if available" ON) IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") SET( USE_ICONV ON ) + FIND_PACKAGE(Security) + FIND_PACKAGE(CoreFoundation REQUIRED) ENDIF() IF(MSVC) @@ -57,17 +59,25 @@ # are linking statically OPTION( STATIC_CRT "Link the static CRT libraries" ON ) + ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) + ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE) +ENDIF() + + +IF(WIN32) # By default, libgit2 is built with WinHTTP. To use the built-in # HTTP transport, invoke CMake with the "-DWINHTTP=OFF" argument. - OPTION( WINHTTP "Use Win32 WinHTTP routines" ON ) + OPTION( WINHTTP "Use Win32 WinHTTP routines" ON ) +ENDIF() - # If you want to embed a copy of libssh2 into libgit2, pass a - # path to libssh2 - OPTION( EMBED_SSH_PATH "Path to libssh2 to embed (Windows)" OFF ) +IF(MSVC) + # Enable MSVC CRTDBG memory leak reporting when in debug mode. + OPTION(MSVC_CRTDBG "Enable CRTDBG memory leak reporting" OFF) +ENDIF() - ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) - ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE) +IF (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + OPTION( USE_OPENSSL "Link with and use openssl library" ON ) ENDIF() # This variable will contain the libraries we need to put into @@ -90,12 +100,14 @@ TARGET_LINK_LIBRARIES(${target} ws2_32) ELSEIF(CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") TARGET_LINK_LIBRARIES(${target} socket nsl) - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lsocket -lnsl" PARENT_SCOPE) + LIST(APPEND LIBGIT2_PC_LIBS "-lsocket" "-lnsl") + SET(LIBGIT2_PC_LIBS ${LIBGIT2_PC_LIBS} PARENT_SCOPE) ENDIF() CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" NEED_LIBRT) IF(NEED_LIBRT) TARGET_LINK_LIBRARIES(${target} rt) - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lrt" PARENT_SCOPE) + LIST(APPEND LIBGIT2_PC_LIBS "-lrt") + SET(LIBGIT2_PC_LIBS ${LIBGIT2_PC_LIBS} PARENT_SCOPE) ENDIF() IF(THREADSAFE) @@ -139,27 +151,77 @@ # Find required dependencies INCLUDE_DIRECTORIES(src include) -IF (WIN32 AND EMBED_SSH_PATH) - FILE(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c") - INCLUDE_DIRECTORIES("${EMBED_SSH_PATH}/include") - FILE(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"") - ADD_DEFINITIONS(-DGIT_SSH) +IF (SECURITY_FOUND) + MESSAGE("-- Found Security ${SECURITY_DIRS}") + LIST(APPEND LIBGIT2_PC_LIBS "-framework Security") ENDIF() -IF (WIN32 AND WINHTTP AND NOT MINGW) +IF (COREFOUNDATION_FOUND) + MESSAGE("-- Found CoreFoundation ${COREFOUNDATION_DIRS}") + LIST(APPEND LIBGIT2_PC_LIBS "-framework CoreFoundation") +ENDIF() + + +IF (WIN32 AND WINHTTP) ADD_DEFINITIONS(-DGIT_WINHTTP) INCLUDE_DIRECTORIES(deps/http-parser) FILE(GLOB SRC_HTTP deps/http-parser/*.c deps/http-parser/*.h) + + # Since MinGW does not come with headers or an import library for winhttp, + # we have to include a private header and generate our own import library + IF (MINGW) + FIND_PROGRAM(DLLTOOL dlltool CMAKE_FIND_ROOT_PATH_BOTH) + IF (NOT DLLTOOL) + MESSAGE(FATAL_ERROR "Could not find dlltool command") + ENDIF () + + SET(LIBWINHTTP_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps/winhttp") + FILE(MAKE_DIRECTORY ${LIBWINHTTP_PATH}) + + IF ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") + set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp64.def") + ELSE() + set(WINHTTP_DEF "${CMAKE_CURRENT_SOURCE_DIR}/deps/winhttp/winhttp.def") + ENDIF() + + ADD_CUSTOM_COMMAND( + OUTPUT ${LIBWINHTTP_PATH}/libwinhttp.a + COMMAND ${DLLTOOL} -d ${WINHTTP_DEF} -k -D winhttp.dll -l libwinhttp.a + DEPENDS ${WINHTTP_DEF} + WORKING_DIRECTORY ${LIBWINHTTP_PATH} + ) + + SET_SOURCE_FILES_PROPERTIES( + ${CMAKE_CURRENT_SOURCE_DIR}/src/transports/winhttp.c + PROPERTIES OBJECT_DEPENDS ${LIBWINHTTP_PATH}/libwinhttp.a + ) + + INCLUDE_DIRECTORIES(deps/winhttp) + LINK_DIRECTORIES(${LIBWINHTTP_PATH}) + ENDIF () + + LINK_LIBRARIES(winhttp rpcrt4 crypt32) ELSE () - IF (NOT AMIGA) + IF (CURL) + PKG_CHECK_MODULES(CURL libcurl) + ENDIF () + + IF (NOT AMIGA AND USE_OPENSSL) FIND_PACKAGE(OpenSSL) ENDIF () + IF (CURL_FOUND) + ADD_DEFINITIONS(-DGIT_CURL) + INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) + LINK_LIBRARIES(${CURL_LIBRARIES}) + LIST(APPEND LIBGIT2_PC_LIBS ${CURL_LDFLAGS}) + ENDIF() + FIND_PACKAGE(HTTP_Parser) IF (HTTP_PARSER_FOUND AND HTTP_PARSER_VERSION_MAJOR EQUAL 2) INCLUDE_DIRECTORIES(${HTTP_PARSER_INCLUDE_DIRS}) LINK_LIBRARIES(${HTTP_PARSER_LIBRARIES}) - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lhttp_parser") + LIST(APPEND LIBGIT2_PC_LIBS "-lhttp_parser") ELSE() MESSAGE(STATUS "http-parser was not found or is too old; using bundled 3rd-party sources.") INCLUDE_DIRECTORIES(deps/http-parser) @@ -176,7 +238,7 @@ ELSEIF (OPENSSL_FOUND AND NOT SHA1_TYPE STREQUAL "builtin") ADD_DEFINITIONS(-DOPENSSL_SHA1) IF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lssl") + LIST(APPEND LIBGIT2_PC_LIBS "-lssl") ELSE() SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} openssl") ENDIF () @@ -190,7 +252,7 @@ ENDIF() # Include POSIX regex when it is required -IF(WIN32 OR AMIGA OR ANDROID OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") +IF(WIN32 OR AMIGA OR CMAKE_SYSTEM_NAME MATCHES "(Solaris|SunOS)") INCLUDE_DIRECTORIES(deps/regex) SET(SRC_REGEX deps/regex/regex.c) ENDIF() @@ -201,7 +263,7 @@ INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS}) LINK_LIBRARIES(${ZLIB_LIBRARIES}) IF(APPLE OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD") - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} -lz") + LIST(APPEND LIBGIT2_PC_LIBS "-lz") ELSE() SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} zlib") ENDIF() @@ -220,8 +282,16 @@ ADD_DEFINITIONS(-DGIT_SSH) INCLUDE_DIRECTORIES(${LIBSSH2_INCLUDE_DIRS}) LINK_DIRECTORIES(${LIBSSH2_LIBRARY_DIRS}) - SET(LIBGIT2_PC_REQUIRES "${LIBGIT2_PC_REQUIRES} libssh2") + LIST(APPEND LIBGIT2_PC_LIBS ${LIBSSH2_LDFLAGS}) + #SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${LIBSSH2_LDFLAGS}") SET(SSH_LIBRARIES ${LIBSSH2_LIBRARIES}) + + CHECK_LIBRARY_EXISTS("${LIBSSH2_LIBRARIES}" libssh2_userauth_publickey_frommemory "" HAVE_LIBSSH2_MEMORY_CREDENTIALS) + IF (HAVE_LIBSSH2_MEMORY_CREDENTIALS) + ADD_DEFINITIONS(-DGIT_SSH_MEMORY_CREDENTIALS) + ENDIF() +ELSE() + MESSAGE(STATUS "LIBSSH2 not found. Set CMAKE_PREFIX_PATH if it is installed outside of the default search path.") ENDIF() # Optional external dependency: libgssapi @@ -239,7 +309,7 @@ IF (ICONV_FOUND) ADD_DEFINITIONS(-DGIT_USE_ICONV) INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR}) - SET(LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS} ${ICONV_LIBRARIES}") + LIST(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES}) ENDIF() # Platform specific compilation flags @@ -264,6 +334,10 @@ SET(CRT_FLAG_RELEASE "/MD") ENDIF() + IF (MSVC_CRTDBG) + SET(CRT_FLAG_DEBUG "${CRT_FLAG_DEBUG} /DGIT_MSVC_CRTDBG") + ENDIF() + # /Zi - Create debugging information # /Od - Disable optimization # /D_DEBUG - #define _DEBUG @@ -338,6 +412,7 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") ENDIF () + ADD_C_FLAG_IF_SUPPORTED(-Wdocumentation) ADD_C_FLAG_IF_SUPPORTED(-Wno-missing-field-initializers) ADD_C_FLAG_IF_SUPPORTED(-Wstrict-aliasing=2) ADD_C_FLAG_IF_SUPPORTED(-Wstrict-prototypes) @@ -365,12 +440,19 @@ # that uses CMAKE_CONFIGURATION_TYPES and not CMAKE_BUILD_TYPE ENDIF() +IF (SECURITY_FOUND) + ADD_DEFINITIONS(-DGIT_SECURE_TRANSPORT) + INCLUDE_DIRECTORIES(${SECURITY_INCLUDE_DIR}) +ENDIF () + IF (OPENSSL_FOUND) - ADD_DEFINITIONS(-DGIT_SSL) + ADD_DEFINITIONS(-DGIT_OPENSSL) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) SET(SSL_LIBRARIES ${OPENSSL_LIBRARIES}) ENDIF() + + IF (THREADSAFE) IF (NOT WIN32) FIND_PACKAGE(Threads REQUIRED) @@ -408,7 +490,9 @@ ENDIF() # Compile and link libgit2 -ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1} ${WIN_RC}) +ADD_LIBRARY(git2 ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1} ${WIN_RC}) +TARGET_LINK_LIBRARIES(git2 ${SECURITY_DIRS}) +TARGET_LINK_LIBRARIES(git2 ${COREFOUNDATION_DIRS}) TARGET_LINK_LIBRARIES(git2 ${SSL_LIBRARIES}) TARGET_LINK_LIBRARIES(git2 ${SSH_LIBRARIES}) TARGET_LINK_LIBRARIES(git2 ${GSSAPI_LIBRARIES}) @@ -431,6 +515,7 @@ SET_TARGET_PROPERTIES(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME}) ENDIF() ENDIF() +STRING(REPLACE ";" " " LIBGIT2_PC_LIBS "${LIBGIT2_PC_LIBS}") CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libgit2.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libgit2.pc @ONLY) IF (MSVC_IDE) @@ -462,7 +547,7 @@ INCLUDE_DIRECTORIES(${CLAR_PATH}) FILE(GLOB_RECURSE SRC_TEST ${CLAR_PATH}/*/*.c ${CLAR_PATH}/*/*.h) - SET(SRC_CLAR "${CLAR_PATH}/main.c" "${CLAR_PATH}/clar_libgit2.c" "${CLAR_PATH}/clar.c") + SET(SRC_CLAR "${CLAR_PATH}/main.c" "${CLAR_PATH}/clar_libgit2.c" "${CLAR_PATH}/clar_libgit2_trace.c" "${CLAR_PATH}/clar_libgit2_timer.c" "${CLAR_PATH}/clar.c") ADD_CUSTOM_COMMAND( OUTPUT ${CLAR_PATH}/clar.suite @@ -475,8 +560,10 @@ ${CLAR_PATH}/clar.c PROPERTIES OBJECT_DEPENDS ${CLAR_PATH}/clar.suite) - ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SSH} ${SRC_SHA1}) + ADD_EXECUTABLE(libgit2_clar ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_CLAR} ${SRC_TEST} ${SRC_ZLIB} ${SRC_HTTP} ${SRC_REGEX} ${SRC_SHA1}) + TARGET_LINK_LIBRARIES(libgit2_clar ${COREFOUNDATION_DIRS}) + TARGET_LINK_LIBRARIES(libgit2_clar ${SECURITY_DIRS}) TARGET_LINK_LIBRARIES(libgit2_clar ${SSL_LIBRARIES}) TARGET_LINK_LIBRARIES(libgit2_clar ${SSH_LIBRARIES}) TARGET_LINK_LIBRARIES(libgit2_clar ${GSSAPI_LIBRARIES}) @@ -490,7 +577,11 @@ ENDIF () ENABLE_TESTING() - ADD_TEST(libgit2_clar libgit2_clar -ionline) + IF (WINHTTP OR OPENSSL_FOUND OR SECURITY_FOUND) + ADD_TEST(libgit2_clar libgit2_clar -ionline) + ELSE () + ADD_TEST(libgit2_clar libgit2_clar -v) + ENDIF () ENDIF () IF (TAGS) diff -Nru libgit2-0.22.2/COPYING libgit2-0.23.1/COPYING --- libgit2-0.22.2/COPYING 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/COPYING 2015-08-03 18:07:35.000000000 +0000 @@ -388,27 +388,21 @@ ---------------------------------------------------------------------- -The Clar framework is licensed under the MIT license: +The Clar framework is licensed under the ISC license: -Copyright (C) 2011 by Vicent Marti +Copyright (c) 2011-2015 Vicent Marti -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ---------------------------------------------------------------------- diff -Nru libgit2-0.22.2/debian/changelog libgit2-0.23.1/debian/changelog --- libgit2-0.22.2/debian/changelog 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/changelog 2016-04-18 13:18:09.000000000 +0000 @@ -1,3 +1,23 @@ +libgit2 (0.23.1-1~wily1) wily; urgency=medium + + * release backport from Ubuntu Xenial to Ubuntu Wily in Sonic Pi PPA. + + -- Hanno Zulla Mon, 18 Apr 2016 15:17:36 +0200 + +libgit2 (0.23.1-1) unstable; urgency=medium + + * New upstream release 0.23.1. + * debian/control: Added build dependency on libcurl4-openssl-dev. + * debian/control: Updated VCS URL. + * debian/copyright: Added winhttp copyright. + * debian/docs: Added missing development documentation. + * debian/libgit2-23.symbols: Updated with latest symbols. + * debian/libgit2-dev.lintian-overrides: Override comment + stripping, should work once it's supported by dh_strip. + * debian/patches/disable_tests.patch: Updated for 0.23.0. + + -- Russell Sim Tue, 11 Aug 2015 08:51:39 +1000 + libgit2 (0.22.2-2) unstable; urgency=medium * debian/control: Added dependency on pkg-config (Closes: #786494) diff -Nru libgit2-0.22.2/debian/control libgit2-0.23.1/debian/control --- libgit2-0.22.2/debian/control 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/control 2015-08-10 22:53:26.000000000 +0000 @@ -3,21 +3,21 @@ Priority: extra Maintainer: Russell Sim Build-Depends: debhelper (>= 9.20120417), python-minimal (>= 2.4.0), pkg-config, - cmake, libz-dev, libssl-dev, libssh2-1-dev, libhttp-parser-dev, - ca-certificates + cmake, libz-dev, libcurl4-openssl-dev, libssl-dev, + libssh2-1-dev, libhttp-parser-dev, ca-certificates Standards-Version: 3.9.6 Homepage: http://libgit2.github.com/ Vcs-Git: git://anonscm.debian.org/users/arrsim-guest/libgit2.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=users/arrsim-guest/libgit2.git;a=summary +Vcs-Browser: http://anonscm.debian.org/cgit/users/arrsim-guest/libgit2.git/ Package: libgit2-dev Architecture: any Section: libdevel Multi-Arch: same -Depends: libgit2-22 (= ${binary:Version}), libz-dev, - libssl-dev, libssh2-1-dev, libhttp-parser-dev, - ${shlibs:Depends}, ${misc:Depends} +Depends: libgit2-23 (= ${binary:Version}), libz-dev, + libcurl4-openssl-dev, libssl-dev, libssh2-1-dev, + libhttp-parser-dev, ${shlibs:Depends}, ${misc:Depends} Description: low-level Git library (development files) libgit2 is a portable, pure C implementation of the Git distributed version control system core methods provided as a @@ -25,7 +25,7 @@ . This package contains the development files for libgit2. -Package: libgit2-22 +Package: libgit2-23 Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} @@ -39,7 +39,7 @@ Section: debug Architecture: any Multi-Arch: same -Depends: libgit2-22 (= ${binary:Version}), +Depends: libgit2-23 (= ${binary:Version}), ${misc:Depends} Description: libgit2 library and debugging symbols libgit2 is a portable, pure C implementation of the Git diff -Nru libgit2-0.22.2/debian/copyright libgit2-0.23.1/debian/copyright --- libgit2-0.22.2/debian/copyright 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/copyright 2015-08-10 22:53:26.000000000 +0000 @@ -11,7 +11,7 @@ License: BSD-2-clause Files: debian/* -Copyright: 2011-2014, Russell Sim +Copyright: 2011-2015, Russell Sim License: GPL-2+ Files: deps/regex/* @@ -27,6 +27,10 @@ Copyright: Igor Sysoev, Joyent, Inc. and other Node contributors License: MIT+NGINX +Files: deps/winhttp/winhttp.h +Copyright: 2007, Francois Gouget +License: LGPL-2.1+ + Files: examples/* Copyright: Public Domain License: CC0 @@ -44,13 +48,14 @@ 2011, Vicent Marti License: MIT -Files: src/path.c +Files: src/path.c src/fnmatch.h Copyright: 2008, The Android Open Source Project License: BSD-2-clause -Files: src/util.c src/fnmatch.h -Copyright: 1990, Regents of the University of California. -License: BSD-3-clause +Files: src/util.c +Copyright: 2009, Public Software Group e. V., Berlin, Germany + 1990, Regents of the University of California. +License: MIT and BSD-3-clause Files: src/xdiff/* Copyright: 2003, Davide Libenzi diff -Nru libgit2-0.22.2/debian/docs libgit2-0.23.1/debian/docs --- libgit2-0.22.2/debian/docs 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/docs 2015-08-10 22:53:26.000000000 +0000 @@ -0,0 +1,2 @@ +THREADING.md +docs/* diff -Nru libgit2-0.22.2/debian/libgit2-22.install libgit2-0.23.1/debian/libgit2-22.install --- libgit2-0.22.2/debian/libgit2-22.install 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-22.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -/usr/lib/*/lib*so.* diff -Nru libgit2-0.22.2/debian/libgit2-22.lintian-overrides libgit2-0.23.1/debian/libgit2-22.lintian-overrides --- libgit2-0.22.2/debian/libgit2-22.lintian-overrides 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-22.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -libgit2-22: spelling-error-in-binary diff -Nru libgit2-0.22.2/debian/libgit2-22.symbols libgit2-0.23.1/debian/libgit2-22.symbols --- libgit2-0.22.2/debian/libgit2-22.symbols 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-22.symbols 1970-01-01 00:00:00.000000000 +0000 @@ -1,709 +0,0 @@ -libgit2.so.22 libgit2-22 #MINVER# - git_annotated_commit_free@Base 0.22.0 - git_annotated_commit_from_fetchhead@Base 0.22.0 - git_annotated_commit_from_ref@Base 0.22.0 - git_annotated_commit_id@Base 0.22.0 - git_annotated_commit_lookup@Base 0.22.0 - git_attr_add_macro@Base 0.17.0 - git_attr_cache_flush@Base 0.17.0 - git_attr_foreach@Base 0.17.0 - git_attr_get@Base 0.17.0 - git_attr_get_many@Base 0.17.0 - git_attr_value@Base 0.18.0 - git_blame_buffer@Base 0.20.0 - git_blame_file@Base 0.20.0 - git_blame_free@Base 0.20.0 - git_blame_get_hunk_byindex@Base 0.20.0 - git_blame_get_hunk_byline@Base 0.20.0 - git_blame_get_hunk_count@Base 0.20.0 - git_blame_init_options@Base 0.21.0 - git_blob_create_frombuffer@Base 0.17.0 - git_blob_create_fromchunks@Base 0.18.0 - git_blob_create_fromdisk@Base 0.17.0 - git_blob_create_fromworkdir@Base 0.18.0 - git_blob_filtered_content@Base 0.20.0 - git_blob_free@Base 0.19.0 - git_blob_id@Base 0.19.0 - git_blob_is_binary@Base 0.18.0 - git_blob_lookup@Base 0.19.0 - git_blob_lookup_prefix@Base 0.19.0 - git_blob_owner@Base 0.19.0 - git_blob_rawcontent@Base 0.17.0 - git_blob_rawsize@Base 0.17.0 - git_branch_create@Base 0.17.0 - git_branch_delete@Base 0.17.0 - git_branch_is_head@Base 0.18.0 - git_branch_iterator_free@Base 0.20.0 - git_branch_iterator_new@Base 0.20.0 - git_branch_lookup@Base 0.18.0 - git_branch_move@Base 0.17.0 - git_branch_name@Base 0.18.0 - git_branch_next@Base 0.20.0 - git_branch_remote_name@Base 0.18.0 - git_branch_set_upstream@Base 0.18.0 - git_branch_upstream@Base 0.18.0 - git_branch_upstream_name@Base 0.18.0 - git_branch_upstream_remote@Base 0.22.0 - git_buf_contains_nul@Base 0.22.0 - git_buf_free@Base 0.20.0 - git_buf_grow@Base 0.20.0 - git_buf_is_binary@Base 0.22.0 - git_buf_set@Base 0.20.0 - git_checkout_head@Base 0.18.0 - git_checkout_index@Base 0.18.0 - git_checkout_init_options@Base 0.21.0 - git_checkout_tree@Base 0.18.0 - git_cherrypick@Base 0.22.0 - git_cherrypick_commit@Base 0.22.0 - git_cherrypick_init_options@Base 0.22.0 - git_clone@Base 0.18.0 - git_clone_init_options@Base 0.21.0 - git_commit_amend@Base 0.21.0 - git_commit_author@Base 0.17.0 - git_commit_committer@Base 0.17.0 - git_commit_create@Base 0.17.0 - git_commit_create_from_callback@Base 0.21.0 - git_commit_create_from_ids@Base 0.21.0 - git_commit_create_v@Base 0.17.0 - git_commit_free@Base 0.19.0 - git_commit_id@Base 0.17.0 - git_commit_lookup@Base 0.19.0 - git_commit_lookup_prefix@Base 0.19.0 - git_commit_message@Base 0.17.0 - git_commit_message_encoding@Base 0.17.0 - git_commit_message_raw@Base 0.20.0 - git_commit_nth_gen_ancestor@Base 0.18.0 - git_commit_owner@Base 0.19.0 - git_commit_parent@Base 0.17.0 - git_commit_parent_id@Base 0.18.0 - git_commit_parentcount@Base 0.17.0 - git_commit_raw_header@Base 0.20.0 - git_commit_summary@Base 0.21.0 - git_commit_time@Base 0.17.0 - git_commit_time_offset@Base 0.17.0 - git_commit_tree@Base 0.17.0 - git_commit_tree_id@Base 0.18.0 - git_config_add_backend@Base 0.18.0 - git_config_add_file_ondisk@Base 0.17.0 - git_config_backend_foreach_match@Base 0.20.0 - git_config_delete_entry@Base 0.18.0 - git_config_delete_multivar@Base 0.20.0 - git_config_find_global@Base 0.17.0 - git_config_find_system@Base 0.17.0 - git_config_find_xdg@Base 0.18.0 - git_config_foreach@Base 0.17.0 - git_config_foreach_match@Base 0.18.0 - git_config_free@Base 0.17.0 - git_config_get_bool@Base 0.17.0 - git_config_get_entry@Base 0.18.0 - git_config_get_int32@Base 0.17.0 - git_config_get_int64@Base 0.17.0 - git_config_get_mapped@Base 0.17.0 - git_config_get_multivar_foreach@Base 0.20.0 - git_config_get_string@Base 0.17.0 - git_config_init_backend@Base 0.21.0 - git_config_iterator_free@Base 0.20.0 - git_config_iterator_glob_new@Base 0.20.0 - git_config_iterator_new@Base 0.20.0 - git_config_lookup_map_value@Base 0.18.0 - git_config_multivar_iterator_new@Base 0.20.0 - git_config_new@Base 0.17.0 - git_config_next@Base 0.20.0 - git_config_open_default@Base 0.18.0 - git_config_open_global@Base 0.19.0 - git_config_open_level@Base 0.18.0 - git_config_open_ondisk@Base 0.17.0 - git_config_parse_bool@Base 0.18.0 - git_config_parse_int32@Base 0.18.0 - git_config_parse_int64@Base 0.18.0 - git_config_set_bool@Base 0.17.0 - git_config_set_int32@Base 0.17.0 - git_config_set_int64@Base 0.17.0 - git_config_set_multivar@Base 0.17.0 - git_config_set_string@Base 0.17.0 - git_config_snapshot@Base 0.21.0 - git_cred_default_new@Base 0.20.0 - git_cred_has_username@Base 0.20.0 - git_cred_ssh_custom_new@Base 0.20.0 - git_cred_ssh_interactive_new@Base 0.21.0 - git_cred_ssh_key_from_agent@Base 0.21.0 - git_cred_ssh_key_new@Base 0.20.0 - git_cred_username_new@Base 0.22.0 - git_cred_userpass@Base 0.18.0 - git_cred_userpass_plaintext_new@Base 0.18.0 - git_describe_commit@Base 0.22.0 - git_describe_format@Base 0.22.0 - git_describe_init_format_options@Base 0.22.0 - git_describe_init_options@Base 0.22.0 - git_describe_result_free@Base 0.22.0 - git_describe_workdir@Base 0.22.0 - git_diff_blob_to_buffer@Base 0.18.0 - git_diff_blobs@Base 0.17.0 - git_diff_buffers@Base 0.21.0 - git_diff_commit_as_email@Base 0.21.0 - git_diff_find_init_options@Base 0.21.0 - git_diff_find_similar@Base 0.18.0 - git_diff_foreach@Base 0.17.0 - git_diff_format_email@Base 0.21.0 - git_diff_format_email_init_options@Base 0.21.0 - git_diff_free@Base 0.20.0 - git_diff_get_delta@Base 0.20.0 - git_diff_get_perfdata@Base 0.21.0 - git_diff_get_stats@Base 0.21.0 - git_diff_index_to_workdir@Base 0.18.0 - git_diff_init_options@Base 0.21.0 - git_diff_is_sorted_icase@Base 0.20.0 - git_diff_merge@Base 0.17.0 - git_diff_num_deltas@Base 0.18.0 - git_diff_num_deltas_of_type@Base 0.18.0 - git_diff_print@Base 0.20.0 - git_diff_print_callback__to_buf@Base 0.21.0 - git_diff_print_callback__to_file_handle@Base 0.21.0 - git_diff_stats_deletions@Base 0.21.0 - git_diff_stats_files_changed@Base 0.21.0 - git_diff_stats_free@Base 0.21.0 - git_diff_stats_insertions@Base 0.21.0 - git_diff_stats_to_buf@Base 0.21.0 - git_diff_status_char@Base 0.18.0 - git_diff_tree_to_index@Base 0.18.0 - git_diff_tree_to_tree@Base 0.17.0 - git_diff_tree_to_workdir@Base 0.18.0 - git_diff_tree_to_workdir_with_index@Base 0.20.0 - git_filter_list_apply_to_blob@Base 0.20.0 - git_filter_list_apply_to_data@Base 0.20.0 - git_filter_list_apply_to_file@Base 0.20.0 - git_filter_list_free@Base 0.20.0 - git_filter_list_length@Base 0.20.0 - git_filter_list_load@Base 0.20.0 - git_filter_list_new@Base 0.20.0 - git_filter_list_push@Base 0.20.0 - git_filter_lookup@Base 0.20.0 - git_filter_register@Base 0.20.0 - git_filter_source_filemode@Base 0.20.0 - git_filter_source_id@Base 0.20.0 - git_filter_source_mode@Base 0.20.0 - git_filter_source_options@Base 0.21.0 - git_filter_source_path@Base 0.20.0 - git_filter_source_repo@Base 0.20.0 - git_filter_unregister@Base 0.20.0 - git_graph_ahead_behind@Base 0.18.0 - git_graph_descendant_of@Base 0.21.0 - git_hashsig_compare@Base 0.22.0 - git_hashsig_create@Base 0.22.0 - git_hashsig_create_fromfile@Base 0.22.0 - git_hashsig_free@Base 0.22.0 - git_ignore_add_rule@Base 0.18.0 - git_ignore_clear_internal_rules@Base 0.18.0 - git_ignore_path_is_ignored@Base 0.18.0 - git_index_add@Base 0.17.0 - git_index_add_all@Base 0.19.0 - git_index_add_bypath@Base 0.18.0 - git_index_caps@Base 0.18.0 - git_index_clear@Base 0.17.0 - git_index_conflict_add@Base 0.18.0 - git_index_conflict_cleanup@Base 0.18.0 - git_index_conflict_get@Base 0.18.0 - git_index_conflict_iterator_free@Base 0.19.0 - git_index_conflict_iterator_new@Base 0.19.0 - git_index_conflict_next@Base 0.19.0 - git_index_conflict_remove@Base 0.18.0 - git_index_entry_stage@Base 0.17.0 - git_index_entrycount@Base 0.17.0 - git_index_find@Base 0.17.0 - git_index_free@Base 0.17.0 - git_index_get_byindex@Base 0.18.0 - git_index_get_bypath@Base 0.18.0 - git_index_has_conflicts@Base 0.18.0 - git_index_name_add@Base 0.19.0 - git_index_name_clear@Base 0.19.0 - git_index_name_entrycount@Base 0.19.0 - git_index_name_get_byindex@Base 0.19.0 - git_index_new@Base 0.18.0 - git_index_open@Base 0.17.0 - git_index_owner@Base 0.18.0 - git_index_path@Base 0.20.0 - git_index_read@Base 0.17.0 - git_index_read_tree@Base 0.17.0 - git_index_remove@Base 0.17.0 - git_index_remove_all@Base 0.19.0 - git_index_remove_bypath@Base 0.18.0 - git_index_remove_directory@Base 0.18.0 - git_index_reuc_add@Base 0.18.0 - git_index_reuc_clear@Base 0.18.0 - git_index_reuc_entrycount@Base 0.18.0 - git_index_reuc_find@Base 0.18.0 - git_index_reuc_get_byindex@Base 0.18.0 - git_index_reuc_get_bypath@Base 0.18.0 - git_index_reuc_remove@Base 0.18.0 - git_index_set_caps@Base 0.18.0 - git_index_update_all@Base 0.19.0 - git_index_write@Base 0.17.0 - git_index_write_tree@Base 0.18.0 - git_index_write_tree_to@Base 0.18.0 - git_indexer_append@Base 0.20.0 - git_indexer_commit@Base 0.20.0 - git_indexer_free@Base 0.20.0 - git_indexer_hash@Base 0.20.0 - git_indexer_new@Base 0.20.0 - git_libgit2_features@Base 0.21.0 - git_libgit2_init@Base 0.22.0 - git_libgit2_opts@Base 0.18.0 - git_libgit2_shutdown@Base 0.22.0 - git_libgit2_version@Base 0.17.0 - git_merge@Base 0.20.0 - git_merge_analysis@Base 0.21.0 - git_merge_base@Base 0.17.0 - git_merge_base_many@Base 0.18.0 - git_merge_base_octopus@Base 0.21.0 - git_merge_bases@Base 0.22.0 - git_merge_bases_many@Base 0.22.0 - git_merge_commits@Base 0.21.0 - git_merge_file@Base 0.21.0 - git_merge_file_from_index@Base 0.21.0 - git_merge_file_init_input@Base 0.21.0 - git_merge_file_init_options@Base 0.21.0 - git_merge_file_result_free@Base 0.21.0 - git_merge_init_options@Base 0.21.0 - git_merge_trees@Base 0.19.0 - git_message_prettify@Base 0.18.0 - git_note_author@Base 0.22.0 - git_note_committer@Base 0.22.0 - git_note_create@Base 0.17.0 - git_note_default_ref@Base 0.17.0 - git_note_foreach@Base 0.17.0 - git_note_free@Base 0.17.0 - git_note_id@Base 0.21.0 - git_note_iterator_free@Base 0.18.0 - git_note_iterator_new@Base 0.18.0 - git_note_message@Base 0.17.0 - git_note_next@Base 0.18.0 - git_note_read@Base 0.17.0 - git_note_remove@Base 0.17.0 - git_object__size@Base 0.17.0 - git_object_dup@Base 0.18.0 - git_object_free@Base 0.17.0 - git_object_id@Base 0.17.0 - git_object_lookup@Base 0.17.0 - git_object_lookup_bypath@Base 0.20.0 - git_object_lookup_prefix@Base 0.17.0 - git_object_owner@Base 0.17.0 - git_object_peel@Base 0.18.0 - git_object_short_id@Base 0.21.0 - git_object_string2type@Base 0.17.0 - git_object_type2string@Base 0.17.0 - git_object_type@Base 0.17.0 - git_object_typeisloose@Base 0.17.0 - git_odb_add_alternate@Base 0.17.0 - git_odb_add_backend@Base 0.17.0 - git_odb_add_disk_alternate@Base 0.18.0 - git_odb_backend_loose@Base 0.17.0 - git_odb_backend_malloc@Base 0.18.0 - git_odb_backend_one_pack@Base 0.18.0 - git_odb_backend_pack@Base 0.17.0 - git_odb_exists@Base 0.17.0 - git_odb_exists_prefix@Base 0.21.0 - git_odb_foreach@Base 0.18.0 - git_odb_free@Base 0.17.0 - git_odb_get_backend@Base 0.19.0 - git_odb_hash@Base 0.17.0 - git_odb_hashfile@Base 0.17.0 - git_odb_init_backend@Base 0.21.0 - git_odb_new@Base 0.17.0 - git_odb_num_backends@Base 0.19.0 - git_odb_object_data@Base 0.17.0 - git_odb_object_dup@Base 0.20.0 - git_odb_object_free@Base 0.17.0 - git_odb_object_id@Base 0.17.0 - git_odb_object_size@Base 0.17.0 - git_odb_object_type@Base 0.17.0 - git_odb_open@Base 0.17.0 - git_odb_open_rstream@Base 0.17.0 - git_odb_open_wstream@Base 0.17.0 - git_odb_read@Base 0.17.0 - git_odb_read_header@Base 0.17.0 - git_odb_read_prefix@Base 0.17.0 - git_odb_refresh@Base 0.18.0 - git_odb_stream_finalize_write@Base 0.20.0 - git_odb_stream_free@Base 0.20.0 - git_odb_stream_read@Base 0.20.0 - git_odb_stream_write@Base 0.20.0 - git_odb_write@Base 0.17.0 - git_odb_write_pack@Base 0.18.0 - git_oid_cmp@Base 0.19.0 - git_oid_cpy@Base 0.17.0 - git_oid_equal@Base 0.21.0 - git_oid_fmt@Base 0.17.0 - git_oid_fromraw@Base 0.17.0 - git_oid_fromstr@Base 0.17.0 - git_oid_fromstrn@Base 0.17.0 - git_oid_fromstrp@Base 0.18.0 - git_oid_iszero@Base 0.17.0 - git_oid_ncmp@Base 0.17.0 - git_oid_nfmt@Base 0.19.0 - git_oid_pathfmt@Base 0.17.0 - git_oid_shorten_add@Base 0.17.0 - git_oid_shorten_free@Base 0.17.0 - git_oid_shorten_new@Base 0.17.0 - git_oid_strcmp@Base 0.19.0 - git_oid_streq@Base 0.17.0 - git_oid_tostr@Base 0.17.0 - git_oid_tostr_s@Base 0.22.0 - git_oidarray_free@Base 0.22.0 - git_openssl_set_locking@Base 0.22.0 - git_packbuilder_foreach@Base 0.18.0 - git_packbuilder_free@Base 0.18.0 - git_packbuilder_hash@Base 0.20.0 - git_packbuilder_insert@Base 0.18.0 - git_packbuilder_insert_commit@Base 0.19.0 - git_packbuilder_insert_tree@Base 0.18.0 - git_packbuilder_new@Base 0.18.0 - git_packbuilder_object_count@Base 0.18.0 - git_packbuilder_set_callbacks@Base 0.20.0 - git_packbuilder_set_threads@Base 0.18.0 - git_packbuilder_write@Base 0.18.0 - git_packbuilder_write_buf@Base 0.21.0 - git_packbuilder_written@Base 0.18.0 - git_patch_free@Base 0.20.0 - git_patch_from_blob_and_buffer@Base 0.20.0 - git_patch_from_blobs@Base 0.20.0 - git_patch_from_buffers@Base 0.21.0 - git_patch_from_diff@Base 0.20.0 - git_patch_get_delta@Base 0.20.0 - git_patch_get_hunk@Base 0.20.0 - git_patch_get_line_in_hunk@Base 0.20.0 - git_patch_line_stats@Base 0.20.0 - git_patch_num_hunks@Base 0.20.0 - git_patch_num_lines_in_hunk@Base 0.20.0 - git_patch_print@Base 0.20.0 - git_patch_size@Base 0.20.0 - git_patch_to_buf@Base 0.21.0 - git_pathspec_free@Base 0.20.0 - git_pathspec_match_diff@Base 0.20.0 - git_pathspec_match_index@Base 0.20.0 - git_pathspec_match_list_diff_entry@Base 0.20.0 - git_pathspec_match_list_entry@Base 0.20.0 - git_pathspec_match_list_entrycount@Base 0.20.0 - git_pathspec_match_list_failed_entry@Base 0.20.0 - git_pathspec_match_list_failed_entrycount@Base 0.20.0 - git_pathspec_match_list_free@Base 0.20.0 - git_pathspec_match_tree@Base 0.20.0 - git_pathspec_match_workdir@Base 0.20.0 - git_pathspec_matches_path@Base 0.20.0 - git_pathspec_new@Base 0.20.0 - git_push_init_options@Base 0.21.0 - git_rebase_abort@Base 0.22.0 - git_rebase_commit@Base 0.22.0 - git_rebase_finish@Base 0.22.0 - git_rebase_free@Base 0.22.0 - git_rebase_init@Base 0.22.0 - git_rebase_init_options@Base 0.22.0 - git_rebase_next@Base 0.22.0 - git_rebase_open@Base 0.22.0 - git_rebase_operation_byindex@Base 0.22.0 - git_rebase_operation_current@Base 0.22.0 - git_rebase_operation_entrycount@Base 0.22.0 - git_refdb_backend_fs@Base 0.18.0 - git_refdb_compress@Base 0.18.0 - git_refdb_free@Base 0.18.0 - git_refdb_init_backend@Base 0.21.0 - git_refdb_new@Base 0.18.0 - git_refdb_open@Base 0.18.0 - git_refdb_set_backend@Base 0.18.0 - git_reference__alloc@Base 0.18.0 - git_reference__alloc_symbolic@Base 0.19.0 - git_reference_cmp@Base 0.17.0 - git_reference_create@Base 0.18.0 - git_reference_create_matching@Base 0.21.0 - git_reference_delete@Base 0.17.0 - git_reference_dwim@Base 0.19.0 - git_reference_ensure_log@Base 0.21.0 - git_reference_foreach@Base 0.17.0 - git_reference_foreach_glob@Base 0.18.0 - git_reference_foreach_name@Base 0.19.0 - git_reference_free@Base 0.17.0 - git_reference_has_log@Base 0.18.0 - git_reference_is_branch@Base 0.18.0 - git_reference_is_note@Base 0.21.0 - git_reference_is_remote@Base 0.18.0 - git_reference_is_tag@Base 0.20.0 - git_reference_is_valid_name@Base 0.18.0 - git_reference_iterator_free@Base 0.19.0 - git_reference_iterator_glob_new@Base 0.19.0 - git_reference_iterator_new@Base 0.19.0 - git_reference_list@Base 0.17.0 - git_reference_lookup@Base 0.17.0 - git_reference_name@Base 0.17.0 - git_reference_name_to_id@Base 0.18.0 - git_reference_next@Base 0.19.0 - git_reference_next_name@Base 0.19.0 - git_reference_normalize_name@Base 0.18.0 - git_reference_owner@Base 0.17.0 - git_reference_peel@Base 0.18.0 - git_reference_remove@Base 0.21.0 - git_reference_rename@Base 0.17.0 - git_reference_resolve@Base 0.17.0 - git_reference_set_target@Base 0.17.0 - git_reference_shorthand@Base 0.19.0 - git_reference_symbolic_create@Base 0.18.0 - git_reference_symbolic_create_matching@Base 0.21.0 - git_reference_symbolic_set_target@Base 0.18.0 - git_reference_symbolic_target@Base 0.18.0 - git_reference_target@Base 0.17.0 - git_reference_target_peel@Base 0.19.0 - git_reference_type@Base 0.17.0 - git_reflog_append@Base 0.18.0 - git_reflog_delete@Base 0.17.0 - git_reflog_drop@Base 0.18.0 - git_reflog_entry_byindex@Base 0.17.0 - git_reflog_entry_committer@Base 0.17.0 - git_reflog_entry_id_new@Base 0.18.0 - git_reflog_entry_id_old@Base 0.18.0 - git_reflog_entry_message@Base 0.18.0 - git_reflog_entrycount@Base 0.17.0 - git_reflog_free@Base 0.17.0 - git_reflog_read@Base 0.17.0 - git_reflog_rename@Base 0.17.0 - git_reflog_write@Base 0.17.0 - git_refspec_direction@Base 0.19.0 - git_refspec_dst@Base 0.17.0 - git_refspec_dst_matches@Base 0.18.0 - git_refspec_force@Base 0.18.0 - git_refspec_rtransform@Base 0.18.0 - git_refspec_src@Base 0.17.0 - git_refspec_src_matches@Base 0.17.0 - git_refspec_string@Base 0.19.0 - git_refspec_transform@Base 0.17.0 - git_remote_add_fetch@Base 0.19.0 - git_remote_add_push@Base 0.19.0 - git_remote_autotag@Base 0.18.0 - git_remote_clear_refspecs@Base 0.19.0 - git_remote_connect@Base 0.17.0 - git_remote_connected@Base 0.17.0 - git_remote_create@Base 0.18.0 - git_remote_create_anonymous@Base 0.21.0 - git_remote_create_with_fetchspec@Base 0.20.0 - git_remote_default_branch@Base 0.21.0 - git_remote_delete@Base 0.21.0 - git_remote_disconnect@Base 0.17.0 - git_remote_download@Base 0.17.0 - git_remote_dup@Base 0.21.0 - git_remote_fetch@Base 0.20.0 - git_remote_free@Base 0.17.0 - git_remote_get_callbacks@Base 0.21.0 - git_remote_get_fetch_refspecs@Base 0.19.0 - git_remote_get_push_refspecs@Base 0.19.0 - git_remote_get_refspec@Base 0.19.0 - git_remote_init_callbacks@Base 0.21.0 - git_remote_is_valid_name@Base 0.18.0 - git_remote_list@Base 0.17.0 - git_remote_lookup@Base 0.22.0 - git_remote_ls@Base 0.17.0 - git_remote_name@Base 0.17.0 - git_remote_owner@Base 0.20.0 - git_remote_prune@Base 0.22.0 - git_remote_prune_refs@Base 0.22.0 - git_remote_push@Base 0.22.0 - git_remote_pushurl@Base 0.18.0 - git_remote_refspec_count@Base 0.19.0 - git_remote_rename@Base 0.18.0 - git_remote_save@Base 0.17.0 - git_remote_set_autotag@Base 0.18.0 - git_remote_set_callbacks@Base 0.18.0 - git_remote_set_fetch_refspecs@Base 0.20.0 - git_remote_set_push_refspecs@Base 0.20.0 - git_remote_set_pushurl@Base 0.18.0 - git_remote_set_transport@Base 0.18.0 - git_remote_set_update_fetchhead@Base 0.18.0 - git_remote_set_url@Base 0.18.0 - git_remote_stats@Base 0.18.0 - git_remote_stop@Base 0.18.0 - git_remote_update_fetchhead@Base 0.18.0 - git_remote_update_tips@Base 0.17.0 - git_remote_upload@Base 0.22.0 - git_remote_url@Base 0.17.0 - git_repository__cleanup@Base 0.19.0 - git_repository_config@Base 0.17.0 - git_repository_config_snapshot@Base 0.21.0 - git_repository_detach_head@Base 0.18.0 - git_repository_discover@Base 0.17.0 - git_repository_fetchhead_foreach@Base 0.18.0 - git_repository_free@Base 0.17.0 - git_repository_get_namespace@Base 0.19.0 - git_repository_hashfile@Base 0.18.0 - git_repository_head@Base 0.17.0 - git_repository_head_detached@Base 0.17.0 - git_repository_head_unborn@Base 0.20.0 - git_repository_index@Base 0.17.0 - git_repository_init@Base 0.17.0 - git_repository_init_ext@Base 0.18.0 - git_repository_init_init_options@Base 0.21.0 - git_repository_is_bare@Base 0.17.0 - git_repository_is_empty@Base 0.17.0 - git_repository_is_shallow@Base 0.19.0 - git_repository_mergehead_foreach@Base 0.18.0 - git_repository_message@Base 0.18.0 - git_repository_message_remove@Base 0.18.0 - git_repository_new@Base 0.19.0 - git_repository_odb@Base 0.17.0 - git_repository_open@Base 0.17.0 - git_repository_open_bare@Base 0.19.0 - git_repository_open_ext@Base 0.17.0 - git_repository_path@Base 0.17.0 - git_repository_refdb@Base 0.18.0 - git_repository_reinit_filesystem@Base 0.20.0 - git_repository_set_bare@Base 0.22.0 - git_repository_set_config@Base 0.17.0 - git_repository_set_head@Base 0.18.0 - git_repository_set_head_detached@Base 0.18.0 - git_repository_set_index@Base 0.17.0 - git_repository_set_namespace@Base 0.19.0 - git_repository_set_odb@Base 0.17.0 - git_repository_set_refdb@Base 0.18.0 - git_repository_set_workdir@Base 0.17.0 - git_repository_state@Base 0.18.0 - git_repository_state_cleanup@Base 0.21.0 - git_repository_workdir@Base 0.17.0 - git_repository_wrap_odb@Base 0.18.0 - git_reset@Base 0.18.0 - git_reset_default@Base 0.18.0 - git_revert@Base 0.21.0 - git_revert_commit@Base 0.22.0 - git_revert_init_options@Base 0.21.0 - git_revparse@Base 0.18.0 - git_revparse_ext@Base 0.19.0 - git_revparse_single@Base 0.18.0 - git_revwalk_add_hide_cb@Base 0.21.0 - git_revwalk_free@Base 0.17.0 - git_revwalk_hide@Base 0.17.0 - git_revwalk_hide_glob@Base 0.17.0 - git_revwalk_hide_head@Base 0.17.0 - git_revwalk_hide_ref@Base 0.17.0 - git_revwalk_new@Base 0.17.0 - git_revwalk_next@Base 0.17.0 - git_revwalk_push@Base 0.17.0 - git_revwalk_push_glob@Base 0.17.0 - git_revwalk_push_head@Base 0.17.0 - git_revwalk_push_range@Base 0.18.0 - git_revwalk_push_ref@Base 0.17.0 - git_revwalk_repository@Base 0.17.0 - git_revwalk_reset@Base 0.17.0 - git_revwalk_simplify_first_parent@Base 0.20.0 - git_revwalk_sorting@Base 0.17.0 - git_signature_default@Base 0.20.0 - git_signature_dup@Base 0.17.0 - git_signature_free@Base 0.17.0 - git_signature_new@Base 0.17.0 - git_signature_now@Base 0.17.0 - git_smart_subtransport_git@Base 0.18.0 - git_smart_subtransport_http@Base 0.18.0 - git_smart_subtransport_ssh@Base 0.20.0 - git_stash_drop@Base 0.18.0 - git_stash_foreach@Base 0.18.0 - git_stash_save@Base 0.18.0 - git_status_byindex@Base 0.19.0 - git_status_file@Base 0.17.0 - git_status_foreach@Base 0.17.0 - git_status_foreach_ext@Base 0.17.0 - git_status_init_options@Base 0.21.0 - git_status_list_entrycount@Base 0.19.0 - git_status_list_free@Base 0.19.0 - git_status_list_get_perfdata@Base 0.21.0 - git_status_list_new@Base 0.19.0 - git_status_should_ignore@Base 0.17.0 - git_strarray_copy@Base 0.17.0 - git_strarray_free@Base 0.17.0 - git_submodule_add_finalize@Base 0.18.0 - git_submodule_add_setup@Base 0.18.0 - git_submodule_add_to_index@Base 0.18.0 - git_submodule_branch@Base 0.21.0 - git_submodule_fetch_recurse_submodules@Base 0.18.0 - git_submodule_foreach@Base 0.17.0 - git_submodule_free@Base 0.21.0 - git_submodule_head_id@Base 0.18.0 - git_submodule_ignore@Base 0.18.0 - git_submodule_index_id@Base 0.18.0 - git_submodule_init@Base 0.18.0 - git_submodule_location@Base 0.18.0 - git_submodule_lookup@Base 0.17.0 - git_submodule_name@Base 0.18.0 - git_submodule_open@Base 0.18.0 - git_submodule_owner@Base 0.18.0 - git_submodule_path@Base 0.18.0 - git_submodule_reload@Base 0.18.0 - git_submodule_reload_all@Base 0.18.0 - git_submodule_repo_init@Base 0.22.0 - git_submodule_resolve_url@Base 0.21.0 - git_submodule_save@Base 0.18.0 - git_submodule_set_fetch_recurse_submodules@Base 0.18.0 - git_submodule_set_ignore@Base 0.18.0 - git_submodule_set_update@Base 0.18.0 - git_submodule_set_url@Base 0.18.0 - git_submodule_status@Base 0.18.0 - git_submodule_sync@Base 0.18.0 - git_submodule_update@Base 0.18.0 - git_submodule_update_init_options@Base 0.22.0 - git_submodule_update_strategy@Base 0.22.0 - git_submodule_url@Base 0.18.0 - git_submodule_wd_id@Base 0.18.0 - git_tag_annotation_create@Base 0.19.0 - git_tag_create@Base 0.17.0 - git_tag_create_frombuffer@Base 0.17.0 - git_tag_create_lightweight@Base 0.17.0 - git_tag_delete@Base 0.17.0 - git_tag_foreach@Base 0.18.0 - git_tag_free@Base 0.19.0 - git_tag_id@Base 0.17.0 - git_tag_list@Base 0.17.0 - git_tag_list_match@Base 0.17.0 - git_tag_lookup@Base 0.19.0 - git_tag_lookup_prefix@Base 0.19.0 - git_tag_message@Base 0.17.0 - git_tag_name@Base 0.17.0 - git_tag_owner@Base 0.19.0 - git_tag_peel@Base 0.17.0 - git_tag_tagger@Base 0.17.0 - git_tag_target@Base 0.17.0 - git_tag_target_id@Base 0.18.0 - git_tag_target_type@Base 0.18.0 - git_trace_set@Base 0.18.0 - git_transport_init@Base 0.21.0 - git_transport_local@Base 0.18.0 - git_transport_new@Base 0.18.0 - git_transport_register@Base 0.20.0 - git_transport_smart@Base 0.18.0 - git_transport_ssh_with_paths@Base 0.22.0 - git_transport_unregister@Base 0.20.0 - git_tree_entry_byid@Base 0.21.0 - git_tree_entry_byindex@Base 0.17.0 - git_tree_entry_byname@Base 0.17.0 - git_tree_entry_bypath@Base 0.18.0 - git_tree_entry_cmp@Base 0.18.0 - git_tree_entry_dup@Base 0.18.0 - git_tree_entry_filemode@Base 0.18.0 - git_tree_entry_filemode_raw@Base 0.20.0 - git_tree_entry_free@Base 0.18.0 - git_tree_entry_id@Base 0.17.0 - git_tree_entry_name@Base 0.17.0 - git_tree_entry_to_object@Base 0.17.0 - git_tree_entry_type@Base 0.17.0 - git_tree_entrycount@Base 0.17.0 - git_tree_free@Base 0.19.0 - git_tree_id@Base 0.17.0 - git_tree_lookup@Base 0.19.0 - git_tree_lookup_prefix@Base 0.19.0 - git_tree_owner@Base 0.18.0 - git_tree_walk@Base 0.17.0 - git_treebuilder_clear@Base 0.17.0 - git_treebuilder_entrycount@Base 0.18.0 - git_treebuilder_filter@Base 0.17.0 - git_treebuilder_free@Base 0.17.0 - git_treebuilder_get@Base 0.17.0 - git_treebuilder_insert@Base 0.17.0 - git_treebuilder_new@Base 0.22.0 - git_treebuilder_remove@Base 0.17.0 - git_treebuilder_write@Base 0.17.0 - giterr_clear@Base 0.17.0 - giterr_detach@Base 0.20.0 - giterr_last@Base 0.17.0 - giterr_set_oom@Base 0.18.0 - giterr_set_str@Base 0.18.0 diff -Nru libgit2-0.22.2/debian/libgit2-23.install libgit2-0.23.1/debian/libgit2-23.install --- libgit2-0.22.2/debian/libgit2-23.install 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-23.install 2015-08-10 22:53:26.000000000 +0000 @@ -0,0 +1 @@ +/usr/lib/*/lib*so.* diff -Nru libgit2-0.22.2/debian/libgit2-23.lintian-overrides libgit2-0.23.1/debian/libgit2-23.lintian-overrides --- libgit2-0.22.2/debian/libgit2-23.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-23.lintian-overrides 2015-08-10 22:53:26.000000000 +0000 @@ -0,0 +1 @@ +libgit2-23: spelling-error-in-binary diff -Nru libgit2-0.22.2/debian/libgit2-23.symbols libgit2-0.23.1/debian/libgit2-23.symbols --- libgit2-0.22.2/debian/libgit2-23.symbols 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-23.symbols 2015-08-10 22:53:26.000000000 +0000 @@ -0,0 +1,731 @@ +libgit2.so.23 libgit2-23 #MINVER# + git_annotated_commit_free@Base 0.22.0 + git_annotated_commit_from_fetchhead@Base 0.22.0 + git_annotated_commit_from_ref@Base 0.22.0 + git_annotated_commit_from_revspec@Base 0.23.0 + git_annotated_commit_id@Base 0.22.0 + git_annotated_commit_lookup@Base 0.22.0 + git_attr_add_macro@Base 0.17.0 + git_attr_cache_flush@Base 0.17.0 + git_attr_foreach@Base 0.17.0 + git_attr_get@Base 0.17.0 + git_attr_get_many@Base 0.17.0 + git_attr_value@Base 0.18.0 + git_blame_buffer@Base 0.20.0 + git_blame_file@Base 0.20.0 + git_blame_free@Base 0.20.0 + git_blame_get_hunk_byindex@Base 0.20.0 + git_blame_get_hunk_byline@Base 0.20.0 + git_blame_get_hunk_count@Base 0.20.0 + git_blame_init_options@Base 0.21.0 + git_blob_create_frombuffer@Base 0.17.0 + git_blob_create_fromchunks@Base 0.18.0 + git_blob_create_fromdisk@Base 0.17.0 + git_blob_create_fromworkdir@Base 0.18.0 + git_blob_filtered_content@Base 0.20.0 + git_blob_free@Base 0.19.0 + git_blob_id@Base 0.19.0 + git_blob_is_binary@Base 0.18.0 + git_blob_lookup@Base 0.19.0 + git_blob_lookup_prefix@Base 0.19.0 + git_blob_owner@Base 0.19.0 + git_blob_rawcontent@Base 0.17.0 + git_blob_rawsize@Base 0.17.0 + git_branch_create@Base 0.17.0 + git_branch_create_from_annotated@Base 0.23.0 + git_branch_delete@Base 0.17.0 + git_branch_is_head@Base 0.18.0 + git_branch_iterator_free@Base 0.20.0 + git_branch_iterator_new@Base 0.20.0 + git_branch_lookup@Base 0.18.0 + git_branch_move@Base 0.17.0 + git_branch_name@Base 0.18.0 + git_branch_next@Base 0.20.0 + git_branch_remote_name@Base 0.18.0 + git_branch_set_upstream@Base 0.18.0 + git_branch_upstream@Base 0.18.0 + git_branch_upstream_name@Base 0.18.0 + git_branch_upstream_remote@Base 0.22.0 + git_buf_contains_nul@Base 0.22.0 + git_buf_free@Base 0.20.0 + git_buf_grow@Base 0.20.0 + git_buf_is_binary@Base 0.22.0 + git_buf_set@Base 0.20.0 + git_checkout_head@Base 0.18.0 + git_checkout_index@Base 0.18.0 + git_checkout_init_options@Base 0.21.0 + git_checkout_tree@Base 0.18.0 + git_cherrypick@Base 0.22.0 + git_cherrypick_commit@Base 0.22.0 + git_cherrypick_init_options@Base 0.22.0 + git_clone@Base 0.18.0 + git_clone_init_options@Base 0.21.0 + git_commit_amend@Base 0.21.0 + git_commit_author@Base 0.17.0 + git_commit_committer@Base 0.17.0 + git_commit_create@Base 0.17.0 + git_commit_create_from_callback@Base 0.21.0 + git_commit_create_from_ids@Base 0.21.0 + git_commit_create_v@Base 0.17.0 + git_commit_free@Base 0.19.0 + git_commit_header_field@Base 0.23.0 + git_commit_id@Base 0.17.0 + git_commit_lookup@Base 0.19.0 + git_commit_lookup_prefix@Base 0.19.0 + git_commit_message@Base 0.17.0 + git_commit_message_encoding@Base 0.17.0 + git_commit_message_raw@Base 0.20.0 + git_commit_nth_gen_ancestor@Base 0.18.0 + git_commit_owner@Base 0.19.0 + git_commit_parent@Base 0.17.0 + git_commit_parent_id@Base 0.18.0 + git_commit_parentcount@Base 0.17.0 + git_commit_raw_header@Base 0.20.0 + git_commit_summary@Base 0.21.0 + git_commit_time@Base 0.17.0 + git_commit_time_offset@Base 0.17.0 + git_commit_tree@Base 0.17.0 + git_commit_tree_id@Base 0.18.0 + git_config_add_backend@Base 0.18.0 + git_config_add_file_ondisk@Base 0.17.0 + git_config_backend_foreach_match@Base 0.20.0 + git_config_delete_entry@Base 0.18.0 + git_config_delete_multivar@Base 0.20.0 + git_config_entry_free@Base 0.23.0 + git_config_find_global@Base 0.17.0 + git_config_find_system@Base 0.17.0 + git_config_find_xdg@Base 0.18.0 + git_config_foreach@Base 0.17.0 + git_config_foreach_match@Base 0.18.0 + git_config_free@Base 0.17.0 + git_config_get_bool@Base 0.17.0 + git_config_get_entry@Base 0.18.0 + git_config_get_int32@Base 0.17.0 + git_config_get_int64@Base 0.17.0 + git_config_get_mapped@Base 0.17.0 + git_config_get_multivar_foreach@Base 0.20.0 + git_config_get_path@Base 0.23.0 + git_config_get_string@Base 0.17.0 + git_config_get_string_buf@Base 0.23.0 + git_config_init_backend@Base 0.21.0 + git_config_iterator_free@Base 0.20.0 + git_config_iterator_glob_new@Base 0.20.0 + git_config_iterator_new@Base 0.20.0 + git_config_lookup_map_value@Base 0.18.0 + git_config_multivar_iterator_new@Base 0.20.0 + git_config_new@Base 0.17.0 + git_config_next@Base 0.20.0 + git_config_open_default@Base 0.18.0 + git_config_open_global@Base 0.19.0 + git_config_open_level@Base 0.18.0 + git_config_open_ondisk@Base 0.17.0 + git_config_parse_bool@Base 0.18.0 + git_config_parse_int32@Base 0.18.0 + git_config_parse_int64@Base 0.18.0 + git_config_parse_path@Base 0.23.0 + git_config_set_bool@Base 0.17.0 + git_config_set_int32@Base 0.17.0 + git_config_set_int64@Base 0.17.0 + git_config_set_multivar@Base 0.17.0 + git_config_set_string@Base 0.17.0 + git_config_snapshot@Base 0.21.0 + git_cred_default_new@Base 0.20.0 + git_cred_has_username@Base 0.20.0 + git_cred_ssh_custom_new@Base 0.20.0 + git_cred_ssh_interactive_new@Base 0.21.0 + git_cred_ssh_key_from_agent@Base 0.21.0 + git_cred_ssh_key_memory_new@Base 0.23.0 + git_cred_ssh_key_new@Base 0.20.0 + git_cred_username_new@Base 0.22.0 + git_cred_userpass@Base 0.18.0 + git_cred_userpass_plaintext_new@Base 0.18.0 + git_describe_commit@Base 0.22.0 + git_describe_format@Base 0.22.0 + git_describe_init_format_options@Base 0.22.0 + git_describe_init_options@Base 0.22.0 + git_describe_result_free@Base 0.22.0 + git_describe_workdir@Base 0.22.0 + git_diff_blob_to_buffer@Base 0.18.0 + git_diff_blobs@Base 0.17.0 + git_diff_buffers@Base 0.21.0 + git_diff_commit_as_email@Base 0.21.0 + git_diff_find_init_options@Base 0.21.0 + git_diff_find_similar@Base 0.18.0 + git_diff_foreach@Base 0.17.0 + git_diff_format_email@Base 0.21.0 + git_diff_format_email_init_options@Base 0.21.0 + git_diff_free@Base 0.20.0 + git_diff_get_delta@Base 0.20.0 + git_diff_get_perfdata@Base 0.21.0 + git_diff_get_stats@Base 0.21.0 + git_diff_index_to_workdir@Base 0.18.0 + git_diff_init_options@Base 0.21.0 + git_diff_is_sorted_icase@Base 0.20.0 + git_diff_merge@Base 0.17.0 + git_diff_num_deltas@Base 0.18.0 + git_diff_num_deltas_of_type@Base 0.18.0 + git_diff_print@Base 0.20.0 + git_diff_print_callback__to_buf@Base 0.21.0 + git_diff_print_callback__to_file_handle@Base 0.21.0 + git_diff_stats_deletions@Base 0.21.0 + git_diff_stats_files_changed@Base 0.21.0 + git_diff_stats_free@Base 0.21.0 + git_diff_stats_insertions@Base 0.21.0 + git_diff_stats_to_buf@Base 0.21.0 + git_diff_status_char@Base 0.18.0 + git_diff_tree_to_index@Base 0.18.0 + git_diff_tree_to_tree@Base 0.17.0 + git_diff_tree_to_workdir@Base 0.18.0 + git_diff_tree_to_workdir_with_index@Base 0.20.0 + git_fetch_init_options@Base 0.23.0 + git_filter_list_apply_to_blob@Base 0.20.0 + git_filter_list_apply_to_data@Base 0.20.0 + git_filter_list_apply_to_file@Base 0.20.0 + git_filter_list_contains@Base 0.23.0 + git_filter_list_free@Base 0.20.0 + git_filter_list_length@Base 0.20.0 + git_filter_list_load@Base 0.20.0 + git_filter_list_new@Base 0.20.0 + git_filter_list_push@Base 0.20.0 + git_filter_list_stream_blob@Base 0.23.0 + git_filter_list_stream_data@Base 0.23.0 + git_filter_list_stream_file@Base 0.23.0 + git_filter_lookup@Base 0.20.0 + git_filter_register@Base 0.20.0 + git_filter_source_filemode@Base 0.20.0 + git_filter_source_flags@Base 0.23.0 + git_filter_source_id@Base 0.20.0 + git_filter_source_mode@Base 0.20.0 + git_filter_source_path@Base 0.20.0 + git_filter_source_repo@Base 0.20.0 + git_filter_unregister@Base 0.20.0 + git_graph_ahead_behind@Base 0.18.0 + git_graph_descendant_of@Base 0.21.0 + git_hashsig_compare@Base 0.22.0 + git_hashsig_create@Base 0.22.0 + git_hashsig_create_fromfile@Base 0.22.0 + git_hashsig_free@Base 0.22.0 + git_ignore_add_rule@Base 0.18.0 + git_ignore_clear_internal_rules@Base 0.18.0 + git_ignore_path_is_ignored@Base 0.18.0 + git_index_add@Base 0.17.0 + git_index_add_all@Base 0.19.0 + git_index_add_bypath@Base 0.18.0 + git_index_add_frombuffer@Base 0.23.0 + git_index_caps@Base 0.18.0 + git_index_checksum@Base 0.23.0 + git_index_clear@Base 0.17.0 + git_index_conflict_add@Base 0.18.0 + git_index_conflict_cleanup@Base 0.18.0 + git_index_conflict_get@Base 0.18.0 + git_index_conflict_iterator_free@Base 0.19.0 + git_index_conflict_iterator_new@Base 0.19.0 + git_index_conflict_next@Base 0.19.0 + git_index_conflict_remove@Base 0.18.0 + git_index_entry_is_conflict@Base 0.23.0 + git_index_entry_stage@Base 0.17.0 + git_index_entrycount@Base 0.17.0 + git_index_find@Base 0.17.0 + git_index_free@Base 0.17.0 + git_index_get_byindex@Base 0.18.0 + git_index_get_bypath@Base 0.18.0 + git_index_has_conflicts@Base 0.18.0 + git_index_name_add@Base 0.19.0 + git_index_name_clear@Base 0.19.0 + git_index_name_entrycount@Base 0.19.0 + git_index_name_get_byindex@Base 0.19.0 + git_index_new@Base 0.18.0 + git_index_open@Base 0.17.0 + git_index_owner@Base 0.18.0 + git_index_path@Base 0.20.0 + git_index_read@Base 0.17.0 + git_index_read_tree@Base 0.17.0 + git_index_remove@Base 0.17.0 + git_index_remove_all@Base 0.19.0 + git_index_remove_bypath@Base 0.18.0 + git_index_remove_directory@Base 0.18.0 + git_index_reuc_add@Base 0.18.0 + git_index_reuc_clear@Base 0.18.0 + git_index_reuc_entrycount@Base 0.18.0 + git_index_reuc_find@Base 0.18.0 + git_index_reuc_get_byindex@Base 0.18.0 + git_index_reuc_get_bypath@Base 0.18.0 + git_index_reuc_remove@Base 0.18.0 + git_index_set_caps@Base 0.18.0 + git_index_update_all@Base 0.19.0 + git_index_write@Base 0.17.0 + git_index_write_tree@Base 0.18.0 + git_index_write_tree_to@Base 0.18.0 + git_indexer_append@Base 0.20.0 + git_indexer_commit@Base 0.20.0 + git_indexer_free@Base 0.20.0 + git_indexer_hash@Base 0.20.0 + git_indexer_new@Base 0.20.0 + git_libgit2_features@Base 0.21.0 + git_libgit2_init@Base 0.22.0 + git_libgit2_opts@Base 0.18.0 + git_libgit2_shutdown@Base 0.22.0 + git_libgit2_version@Base 0.17.0 + git_merge@Base 0.20.0 + git_merge_analysis@Base 0.21.0 + git_merge_base@Base 0.17.0 + git_merge_base_many@Base 0.18.0 + git_merge_base_octopus@Base 0.21.0 + git_merge_bases@Base 0.22.0 + git_merge_bases_many@Base 0.22.0 + git_merge_commits@Base 0.21.0 + git_merge_file@Base 0.21.0 + git_merge_file_from_index@Base 0.21.0 + git_merge_file_init_input@Base 0.21.0 + git_merge_file_init_options@Base 0.21.0 + git_merge_file_result_free@Base 0.21.0 + git_merge_init_options@Base 0.21.0 + git_merge_trees@Base 0.19.0 + git_message_prettify@Base 0.18.0 + git_note_author@Base 0.22.0 + git_note_committer@Base 0.22.0 + git_note_create@Base 0.17.0 + git_note_default_ref@Base 0.17.0 + git_note_foreach@Base 0.17.0 + git_note_free@Base 0.17.0 + git_note_id@Base 0.21.0 + git_note_iterator_free@Base 0.18.0 + git_note_iterator_new@Base 0.18.0 + git_note_message@Base 0.17.0 + git_note_next@Base 0.18.0 + git_note_read@Base 0.17.0 + git_note_remove@Base 0.17.0 + git_object__size@Base 0.17.0 + git_object_dup@Base 0.18.0 + git_object_free@Base 0.17.0 + git_object_id@Base 0.17.0 + git_object_lookup@Base 0.17.0 + git_object_lookup_bypath@Base 0.20.0 + git_object_lookup_prefix@Base 0.17.0 + git_object_owner@Base 0.17.0 + git_object_peel@Base 0.18.0 + git_object_short_id@Base 0.21.0 + git_object_string2type@Base 0.17.0 + git_object_type2string@Base 0.17.0 + git_object_type@Base 0.17.0 + git_object_typeisloose@Base 0.17.0 + git_odb_add_alternate@Base 0.17.0 + git_odb_add_backend@Base 0.17.0 + git_odb_add_disk_alternate@Base 0.18.0 + git_odb_backend_loose@Base 0.17.0 + git_odb_backend_malloc@Base 0.18.0 + git_odb_backend_one_pack@Base 0.18.0 + git_odb_backend_pack@Base 0.17.0 + git_odb_exists@Base 0.17.0 + git_odb_exists_prefix@Base 0.21.0 + git_odb_foreach@Base 0.18.0 + git_odb_free@Base 0.17.0 + git_odb_get_backend@Base 0.19.0 + git_odb_hash@Base 0.17.0 + git_odb_hashfile@Base 0.17.0 + git_odb_init_backend@Base 0.21.0 + git_odb_new@Base 0.17.0 + git_odb_num_backends@Base 0.19.0 + git_odb_object_data@Base 0.17.0 + git_odb_object_dup@Base 0.20.0 + git_odb_object_free@Base 0.17.0 + git_odb_object_id@Base 0.17.0 + git_odb_object_size@Base 0.17.0 + git_odb_object_type@Base 0.17.0 + git_odb_open@Base 0.17.0 + git_odb_open_rstream@Base 0.17.0 + git_odb_open_wstream@Base 0.17.0 + git_odb_read@Base 0.17.0 + git_odb_read_header@Base 0.17.0 + git_odb_read_prefix@Base 0.17.0 + git_odb_refresh@Base 0.18.0 + git_odb_stream_finalize_write@Base 0.20.0 + git_odb_stream_free@Base 0.20.0 + git_odb_stream_read@Base 0.20.0 + git_odb_stream_write@Base 0.20.0 + git_odb_write@Base 0.17.0 + git_odb_write_pack@Base 0.18.0 + git_oid_cmp@Base 0.19.0 + git_oid_cpy@Base 0.17.0 + git_oid_equal@Base 0.21.0 + git_oid_fmt@Base 0.17.0 + git_oid_fromraw@Base 0.17.0 + git_oid_fromstr@Base 0.17.0 + git_oid_fromstrn@Base 0.17.0 + git_oid_fromstrp@Base 0.18.0 + git_oid_iszero@Base 0.17.0 + git_oid_ncmp@Base 0.17.0 + git_oid_nfmt@Base 0.19.0 + git_oid_pathfmt@Base 0.17.0 + git_oid_shorten_add@Base 0.17.0 + git_oid_shorten_free@Base 0.17.0 + git_oid_shorten_new@Base 0.17.0 + git_oid_strcmp@Base 0.19.0 + git_oid_streq@Base 0.17.0 + git_oid_tostr@Base 0.17.0 + git_oid_tostr_s@Base 0.22.0 + git_oidarray_free@Base 0.22.0 + git_openssl_set_locking@Base 0.22.0 + git_packbuilder_foreach@Base 0.18.0 + git_packbuilder_free@Base 0.18.0 + git_packbuilder_hash@Base 0.20.0 + git_packbuilder_insert@Base 0.18.0 + git_packbuilder_insert_commit@Base 0.19.0 + git_packbuilder_insert_recur@Base 0.23.0 + git_packbuilder_insert_tree@Base 0.18.0 + git_packbuilder_insert_walk@Base 0.23.0 + git_packbuilder_new@Base 0.18.0 + git_packbuilder_object_count@Base 0.18.0 + git_packbuilder_set_callbacks@Base 0.20.0 + git_packbuilder_set_threads@Base 0.18.0 + git_packbuilder_write@Base 0.18.0 + git_packbuilder_write_buf@Base 0.21.0 + git_packbuilder_written@Base 0.18.0 + git_patch_free@Base 0.20.0 + git_patch_from_blob_and_buffer@Base 0.20.0 + git_patch_from_blobs@Base 0.20.0 + git_patch_from_buffers@Base 0.21.0 + git_patch_from_diff@Base 0.20.0 + git_patch_get_delta@Base 0.20.0 + git_patch_get_hunk@Base 0.20.0 + git_patch_get_line_in_hunk@Base 0.20.0 + git_patch_line_stats@Base 0.20.0 + git_patch_num_hunks@Base 0.20.0 + git_patch_num_lines_in_hunk@Base 0.20.0 + git_patch_print@Base 0.20.0 + git_patch_size@Base 0.20.0 + git_patch_to_buf@Base 0.21.0 + git_pathspec_free@Base 0.20.0 + git_pathspec_match_diff@Base 0.20.0 + git_pathspec_match_index@Base 0.20.0 + git_pathspec_match_list_diff_entry@Base 0.20.0 + git_pathspec_match_list_entry@Base 0.20.0 + git_pathspec_match_list_entrycount@Base 0.20.0 + git_pathspec_match_list_failed_entry@Base 0.20.0 + git_pathspec_match_list_failed_entrycount@Base 0.20.0 + git_pathspec_match_list_free@Base 0.20.0 + git_pathspec_match_tree@Base 0.20.0 + git_pathspec_match_workdir@Base 0.20.0 + git_pathspec_matches_path@Base 0.20.0 + git_pathspec_new@Base 0.20.0 + git_push_init_options@Base 0.21.0 + git_rebase_abort@Base 0.22.0 + git_rebase_commit@Base 0.22.0 + git_rebase_finish@Base 0.22.0 + git_rebase_free@Base 0.22.0 + git_rebase_init@Base 0.22.0 + git_rebase_init_options@Base 0.22.0 + git_rebase_next@Base 0.22.0 + git_rebase_open@Base 0.22.0 + git_rebase_operation_byindex@Base 0.22.0 + git_rebase_operation_current@Base 0.22.0 + git_rebase_operation_entrycount@Base 0.22.0 + git_refdb_backend_fs@Base 0.18.0 + git_refdb_compress@Base 0.18.0 + git_refdb_free@Base 0.18.0 + git_refdb_init_backend@Base 0.21.0 + git_refdb_new@Base 0.18.0 + git_refdb_open@Base 0.18.0 + git_refdb_set_backend@Base 0.18.0 + git_reference__alloc@Base 0.18.0 + git_reference__alloc_symbolic@Base 0.19.0 + git_reference_cmp@Base 0.17.0 + git_reference_create@Base 0.18.0 + git_reference_create_matching@Base 0.21.0 + git_reference_delete@Base 0.17.0 + git_reference_dwim@Base 0.19.0 + git_reference_ensure_log@Base 0.21.0 + git_reference_foreach@Base 0.17.0 + git_reference_foreach_glob@Base 0.18.0 + git_reference_foreach_name@Base 0.19.0 + git_reference_free@Base 0.17.0 + git_reference_has_log@Base 0.18.0 + git_reference_is_branch@Base 0.18.0 + git_reference_is_note@Base 0.21.0 + git_reference_is_remote@Base 0.18.0 + git_reference_is_tag@Base 0.20.0 + git_reference_is_valid_name@Base 0.18.0 + git_reference_iterator_free@Base 0.19.0 + git_reference_iterator_glob_new@Base 0.19.0 + git_reference_iterator_new@Base 0.19.0 + git_reference_list@Base 0.17.0 + git_reference_lookup@Base 0.17.0 + git_reference_name@Base 0.17.0 + git_reference_name_to_id@Base 0.18.0 + git_reference_next@Base 0.19.0 + git_reference_next_name@Base 0.19.0 + git_reference_normalize_name@Base 0.18.0 + git_reference_owner@Base 0.17.0 + git_reference_peel@Base 0.18.0 + git_reference_remove@Base 0.21.0 + git_reference_rename@Base 0.17.0 + git_reference_resolve@Base 0.17.0 + git_reference_set_target@Base 0.17.0 + git_reference_shorthand@Base 0.19.0 + git_reference_symbolic_create@Base 0.18.0 + git_reference_symbolic_create_matching@Base 0.21.0 + git_reference_symbolic_set_target@Base 0.18.0 + git_reference_symbolic_target@Base 0.18.0 + git_reference_target@Base 0.17.0 + git_reference_target_peel@Base 0.19.0 + git_reference_type@Base 0.17.0 + git_reflog_append@Base 0.18.0 + git_reflog_delete@Base 0.17.0 + git_reflog_drop@Base 0.18.0 + git_reflog_entry_byindex@Base 0.17.0 + git_reflog_entry_committer@Base 0.17.0 + git_reflog_entry_id_new@Base 0.18.0 + git_reflog_entry_id_old@Base 0.18.0 + git_reflog_entry_message@Base 0.18.0 + git_reflog_entrycount@Base 0.17.0 + git_reflog_free@Base 0.17.0 + git_reflog_read@Base 0.17.0 + git_reflog_rename@Base 0.17.0 + git_reflog_write@Base 0.17.0 + git_refspec_direction@Base 0.19.0 + git_refspec_dst@Base 0.17.0 + git_refspec_dst_matches@Base 0.18.0 + git_refspec_force@Base 0.18.0 + git_refspec_rtransform@Base 0.18.0 + git_refspec_src@Base 0.17.0 + git_refspec_src_matches@Base 0.17.0 + git_refspec_string@Base 0.19.0 + git_refspec_transform@Base 0.17.0 + git_remote_add_fetch@Base 0.19.0 + git_remote_add_push@Base 0.19.0 + git_remote_autotag@Base 0.18.0 + git_remote_connect@Base 0.17.0 + git_remote_connected@Base 0.17.0 + git_remote_create@Base 0.18.0 + git_remote_create_anonymous@Base 0.21.0 + git_remote_create_with_fetchspec@Base 0.20.0 + git_remote_default_branch@Base 0.21.0 + git_remote_delete@Base 0.21.0 + git_remote_disconnect@Base 0.17.0 + git_remote_download@Base 0.17.0 + git_remote_dup@Base 0.21.0 + git_remote_fetch@Base 0.20.0 + git_remote_free@Base 0.17.0 + git_remote_get_fetch_refspecs@Base 0.19.0 + git_remote_get_push_refspecs@Base 0.19.0 + git_remote_get_refspec@Base 0.19.0 + git_remote_init_callbacks@Base 0.21.0 + git_remote_is_valid_name@Base 0.18.0 + git_remote_list@Base 0.17.0 + git_remote_lookup@Base 0.22.0 + git_remote_ls@Base 0.17.0 + git_remote_name@Base 0.17.0 + git_remote_owner@Base 0.20.0 + git_remote_prune@Base 0.22.0 + git_remote_prune_refs@Base 0.22.0 + git_remote_push@Base 0.22.0 + git_remote_pushurl@Base 0.18.0 + git_remote_refspec_count@Base 0.19.0 + git_remote_rename@Base 0.18.0 + git_remote_set_autotag@Base 0.18.0 + git_remote_set_pushurl@Base 0.18.0 + git_remote_set_url@Base 0.18.0 + git_remote_stats@Base 0.18.0 + git_remote_stop@Base 0.18.0 + git_remote_update_tips@Base 0.17.0 + git_remote_upload@Base 0.22.0 + git_remote_url@Base 0.17.0 + git_repository__cleanup@Base 0.19.0 + git_repository_config@Base 0.17.0 + git_repository_config_snapshot@Base 0.21.0 + git_repository_detach_head@Base 0.18.0 + git_repository_discover@Base 0.17.0 + git_repository_fetchhead_foreach@Base 0.18.0 + git_repository_free@Base 0.17.0 + git_repository_get_namespace@Base 0.19.0 + git_repository_hashfile@Base 0.18.0 + git_repository_head@Base 0.17.0 + git_repository_head_detached@Base 0.17.0 + git_repository_head_unborn@Base 0.20.0 + git_repository_ident@Base 0.23.0 + git_repository_index@Base 0.17.0 + git_repository_init@Base 0.17.0 + git_repository_init_ext@Base 0.18.0 + git_repository_init_init_options@Base 0.21.0 + git_repository_is_bare@Base 0.17.0 + git_repository_is_empty@Base 0.17.0 + git_repository_is_shallow@Base 0.19.0 + git_repository_mergehead_foreach@Base 0.18.0 + git_repository_message@Base 0.18.0 + git_repository_message_remove@Base 0.18.0 + git_repository_new@Base 0.19.0 + git_repository_odb@Base 0.17.0 + git_repository_open@Base 0.17.0 + git_repository_open_bare@Base 0.19.0 + git_repository_open_ext@Base 0.17.0 + git_repository_path@Base 0.17.0 + git_repository_refdb@Base 0.18.0 + git_repository_reinit_filesystem@Base 0.20.0 + git_repository_set_bare@Base 0.22.0 + git_repository_set_config@Base 0.17.0 + git_repository_set_head@Base 0.18.0 + git_repository_set_head_detached@Base 0.18.0 + git_repository_set_head_detached_from_annotated@Base 0.23.0 + git_repository_set_ident@Base 0.23.0 + git_repository_set_index@Base 0.17.0 + git_repository_set_namespace@Base 0.19.0 + git_repository_set_odb@Base 0.17.0 + git_repository_set_refdb@Base 0.18.0 + git_repository_set_workdir@Base 0.17.0 + git_repository_state@Base 0.18.0 + git_repository_state_cleanup@Base 0.21.0 + git_repository_workdir@Base 0.17.0 + git_repository_wrap_odb@Base 0.18.0 + git_reset@Base 0.18.0 + git_reset_default@Base 0.18.0 + git_reset_from_annotated@Base 0.23.0 + git_revert@Base 0.21.0 + git_revert_commit@Base 0.22.0 + git_revert_init_options@Base 0.21.0 + git_revparse@Base 0.18.0 + git_revparse_ext@Base 0.19.0 + git_revparse_single@Base 0.18.0 + git_revwalk_add_hide_cb@Base 0.21.0 + git_revwalk_free@Base 0.17.0 + git_revwalk_hide@Base 0.17.0 + git_revwalk_hide_glob@Base 0.17.0 + git_revwalk_hide_head@Base 0.17.0 + git_revwalk_hide_ref@Base 0.17.0 + git_revwalk_new@Base 0.17.0 + git_revwalk_next@Base 0.17.0 + git_revwalk_push@Base 0.17.0 + git_revwalk_push_glob@Base 0.17.0 + git_revwalk_push_head@Base 0.17.0 + git_revwalk_push_range@Base 0.18.0 + git_revwalk_push_ref@Base 0.17.0 + git_revwalk_repository@Base 0.17.0 + git_revwalk_reset@Base 0.17.0 + git_revwalk_simplify_first_parent@Base 0.20.0 + git_revwalk_sorting@Base 0.17.0 + git_signature_default@Base 0.20.0 + git_signature_dup@Base 0.17.0 + git_signature_free@Base 0.17.0 + git_signature_new@Base 0.17.0 + git_signature_now@Base 0.17.0 + git_smart_subtransport_git@Base 0.18.0 + git_smart_subtransport_http@Base 0.18.0 + git_smart_subtransport_ssh@Base 0.20.0 + git_stash_apply@Base 0.23.0 + git_stash_drop@Base 0.18.0 + git_stash_foreach@Base 0.18.0 + git_stash_pop@Base 0.23.0 + git_stash_save@Base 0.18.0 + git_status_byindex@Base 0.19.0 + git_status_file@Base 0.17.0 + git_status_foreach@Base 0.17.0 + git_status_foreach_ext@Base 0.17.0 + git_status_init_options@Base 0.21.0 + git_status_list_entrycount@Base 0.19.0 + git_status_list_free@Base 0.19.0 + git_status_list_get_perfdata@Base 0.21.0 + git_status_list_new@Base 0.19.0 + git_status_should_ignore@Base 0.17.0 + git_strarray_copy@Base 0.17.0 + git_strarray_free@Base 0.17.0 + git_submodule_add_finalize@Base 0.18.0 + git_submodule_add_setup@Base 0.18.0 + git_submodule_add_to_index@Base 0.18.0 + git_submodule_branch@Base 0.21.0 + git_submodule_fetch_recurse_submodules@Base 0.18.0 + git_submodule_foreach@Base 0.17.0 + git_submodule_free@Base 0.21.0 + git_submodule_head_id@Base 0.18.0 + git_submodule_ignore@Base 0.18.0 + git_submodule_index_id@Base 0.18.0 + git_submodule_init@Base 0.18.0 + git_submodule_location@Base 0.18.0 + git_submodule_lookup@Base 0.17.0 + git_submodule_name@Base 0.18.0 + git_submodule_open@Base 0.18.0 + git_submodule_owner@Base 0.18.0 + git_submodule_path@Base 0.18.0 + git_submodule_reload@Base 0.18.0 + git_submodule_repo_init@Base 0.22.0 + git_submodule_resolve_url@Base 0.21.0 + git_submodule_set_branch@Base 0.23.0 + git_submodule_set_fetch_recurse_submodules@Base 0.18.0 + git_submodule_set_ignore@Base 0.18.0 + git_submodule_set_update@Base 0.18.0 + git_submodule_set_url@Base 0.18.0 + git_submodule_status@Base 0.18.0 + git_submodule_sync@Base 0.18.0 + git_submodule_update@Base 0.18.0 + git_submodule_update_init_options@Base 0.22.0 + git_submodule_update_strategy@Base 0.22.0 + git_submodule_url@Base 0.18.0 + git_submodule_wd_id@Base 0.18.0 + git_tag_annotation_create@Base 0.19.0 + git_tag_create@Base 0.17.0 + git_tag_create_frombuffer@Base 0.17.0 + git_tag_create_lightweight@Base 0.17.0 + git_tag_delete@Base 0.17.0 + git_tag_foreach@Base 0.18.0 + git_tag_free@Base 0.19.0 + git_tag_id@Base 0.17.0 + git_tag_list@Base 0.17.0 + git_tag_list_match@Base 0.17.0 + git_tag_lookup@Base 0.19.0 + git_tag_lookup_prefix@Base 0.19.0 + git_tag_message@Base 0.17.0 + git_tag_name@Base 0.17.0 + git_tag_owner@Base 0.19.0 + git_tag_peel@Base 0.17.0 + git_tag_tagger@Base 0.17.0 + git_tag_target@Base 0.17.0 + git_tag_target_id@Base 0.18.0 + git_tag_target_type@Base 0.18.0 + git_trace_set@Base 0.18.0 + git_transaction_commit@Base 0.23.0 + git_transaction_free@Base 0.23.0 + git_transaction_lock_ref@Base 0.23.0 + git_transaction_new@Base 0.23.0 + git_transaction_remove@Base 0.23.0 + git_transaction_set_reflog@Base 0.23.0 + git_transaction_set_symbolic_target@Base 0.23.0 + git_transaction_set_target@Base 0.23.0 + git_transport_init@Base 0.21.0 + git_transport_local@Base 0.18.0 + git_transport_new@Base 0.18.0 + git_transport_register@Base 0.20.0 + git_transport_smart@Base 0.18.0 + git_transport_ssh_with_paths@Base 0.22.0 + git_transport_unregister@Base 0.20.0 + git_tree_entry_byid@Base 0.21.0 + git_tree_entry_byindex@Base 0.17.0 + git_tree_entry_byname@Base 0.17.0 + git_tree_entry_bypath@Base 0.18.0 + git_tree_entry_cmp@Base 0.18.0 + git_tree_entry_dup@Base 0.18.0 + git_tree_entry_filemode@Base 0.18.0 + git_tree_entry_filemode_raw@Base 0.20.0 + git_tree_entry_free@Base 0.18.0 + git_tree_entry_id@Base 0.17.0 + git_tree_entry_name@Base 0.17.0 + git_tree_entry_to_object@Base 0.17.0 + git_tree_entry_type@Base 0.17.0 + git_tree_entrycount@Base 0.17.0 + git_tree_free@Base 0.19.0 + git_tree_id@Base 0.17.0 + git_tree_lookup@Base 0.19.0 + git_tree_lookup_prefix@Base 0.19.0 + git_tree_owner@Base 0.18.0 + git_tree_walk@Base 0.17.0 + git_treebuilder_clear@Base 0.17.0 + git_treebuilder_entrycount@Base 0.18.0 + git_treebuilder_filter@Base 0.17.0 + git_treebuilder_free@Base 0.17.0 + git_treebuilder_get@Base 0.17.0 + git_treebuilder_insert@Base 0.17.0 + git_treebuilder_new@Base 0.22.0 + git_treebuilder_remove@Base 0.17.0 + git_treebuilder_write@Base 0.17.0 + giterr_clear@Base 0.17.0 + giterr_detach@Base 0.20.0 + giterr_last@Base 0.17.0 + giterr_set_oom@Base 0.18.0 + giterr_set_str@Base 0.18.0 diff -Nru libgit2-0.22.2/debian/libgit2-dev.lintian-overrides libgit2-0.23.1/debian/libgit2-dev.lintian-overrides --- libgit2-0.22.2/debian/libgit2-dev.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/debian/libgit2-dev.lintian-overrides 2015-08-10 22:53:26.000000000 +0000 @@ -0,0 +1 @@ +libgit2-dev: static-library-has-unneeded-section diff -Nru libgit2-0.22.2/debian/patches/disable_tests.patch libgit2-0.23.1/debian/patches/disable_tests.patch --- libgit2-0.22.2/debian/patches/disable_tests.patch 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/patches/disable_tests.patch 2015-08-10 22:53:26.000000000 +0000 @@ -6,15 +6,15 @@ a repository diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6bd25aa..f44190e 100644 +index 5c55ddd..e28a16f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -349,7 +349,7 @@ IF (BUILD_CLAR) - ENDIF () +@@ -577,7 +577,7 @@ IF (BUILD_CLAR) ENABLE_TESTING() -- ADD_TEST(libgit2_clar libgit2_clar -ionline) -+ ADD_TEST(libgit2_clar libgit2_clar -xonline -xblame::simple::trivial_libgit2 -xnetwork::remote::remotes::single_branch -xnetwork::remote::remotes::restricted_refspecs) - ENDIF () - - IF (TAGS) + IF (WINHTTP OR OPENSSL_FOUND OR SECURITY_FOUND) +- ADD_TEST(libgit2_clar libgit2_clar -ionline) ++ ADD_TEST(libgit2_clar libgit2_clar -xonline -xnetwork::remote::remotes -xobject::cache -xthreads::diff -xthreads::iterator) + ELSE () + ADD_TEST(libgit2_clar libgit2_clar -v) + ENDIF () diff -Nru libgit2-0.22.2/debian/watch libgit2-0.23.1/debian/watch --- libgit2-0.22.2/debian/watch 2015-05-31 13:56:05.000000000 +0000 +++ libgit2-0.23.1/debian/watch 2015-08-10 22:53:26.000000000 +0000 @@ -1,2 +1,3 @@ version=3 -https://github.com/libgit2/libgit2/tags /libgit2/libgit2/archive/v(.+)\.tar\.gz +opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/libgit2-$1\.tar\.gz/ \ + https://github.com/libgit2/libgit2/releases .*/v?([\d.]*)\.tar\.gz diff -Nru libgit2-0.22.2/deps/winhttp/urlmon.h libgit2-0.23.1/deps/winhttp/urlmon.h --- libgit2-0.22.2/deps/winhttp/urlmon.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/deps/winhttp/urlmon.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,45 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#if defined(__MINGW_VERSION) || defined(__MINGW32_VERSION) + +#ifndef __CUSTOM_URLMON_H +#define __CUSTOM_URLMON_H + +typedef struct IInternetSecurityManager IInternetSecurityManager; + +typedef struct IInternetSecurityManagerVtbl +{ + HRESULT(STDMETHODCALLTYPE *QueryInterface)(IInternetSecurityManager *, REFIID, void **); + ULONG(STDMETHODCALLTYPE *AddRef)(IInternetSecurityManager *); + ULONG(STDMETHODCALLTYPE *Release)(IInternetSecurityManager *); + LPVOID SetSecuritySite; + LPVOID GetSecuritySite; + HRESULT(STDMETHODCALLTYPE *MapUrlToZone)(IInternetSecurityManager *, LPCWSTR, DWORD *, DWORD); + LPVOID GetSecurityId; + LPVOID ProcessUrlAction; + LPVOID QueryCustomPolicy; + LPVOID SetZoneMapping; + LPVOID GetZoneMappings; +} IInternetSecurityManagerVtbl; + +struct IInternetSecurityManager +{ + CONST_VTBL struct IInternetSecurityManagerVtbl *lpVtbl; +}; + +#define URLZONE_LOCAL_MACHINE 0 +#define URLZONE_INTRANET 1 +#define URLZONE_TRUSTED 2 + +#endif /* __CUSTOM_URLMON_H */ + +#else + +#include_next + +#endif diff -Nru libgit2-0.22.2/deps/winhttp/winhttp64.def libgit2-0.23.1/deps/winhttp/winhttp64.def --- libgit2-0.22.2/deps/winhttp/winhttp64.def 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/deps/winhttp/winhttp64.def 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,29 @@ +LIBRARY WINHTTP +EXPORTS +WinHttpAddRequestHeaders +WinHttpCheckPlatform +WinHttpCloseHandle +WinHttpConnect +WinHttpCrackUrl +WinHttpCreateUrl +WinHttpDetectAutoProxyConfigUrl +WinHttpGetDefaultProxyConfiguration +WinHttpGetIEProxyConfigForCurrentUser +WinHttpGetProxyForUrl +WinHttpOpen +WinHttpOpenRequest +WinHttpQueryAuthSchemes +WinHttpQueryDataAvailable +WinHttpQueryHeaders +WinHttpQueryOption +WinHttpReadData +WinHttpReceiveResponse +WinHttpSendRequest +WinHttpSetCredentials +WinHttpSetDefaultProxyConfiguration +WinHttpSetOption +WinHttpSetStatusCallback +WinHttpSetTimeouts +WinHttpTimeFromSystemTime +WinHttpTimeToSystemTime +WinHttpWriteData diff -Nru libgit2-0.22.2/deps/winhttp/winhttp.def libgit2-0.23.1/deps/winhttp/winhttp.def --- libgit2-0.22.2/deps/winhttp/winhttp.def 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/deps/winhttp/winhttp.def 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,29 @@ +LIBRARY WINHTTP +EXPORTS +WinHttpAddRequestHeaders@16 +WinHttpCheckPlatform@0 +WinHttpCloseHandle@4 +WinHttpConnect@16 +WinHttpCrackUrl@16 +WinHttpCreateUrl@16 +WinHttpDetectAutoProxyConfigUrl@8 +WinHttpGetDefaultProxyConfiguration@4 +WinHttpGetIEProxyConfigForCurrentUser@4 +WinHttpGetProxyForUrl@16 +WinHttpOpen@20 +WinHttpOpenRequest@28 +WinHttpQueryAuthSchemes@16 +WinHttpQueryDataAvailable@8 +WinHttpQueryHeaders@24 +WinHttpQueryOption@16 +WinHttpReadData@16 +WinHttpReceiveResponse@8 +WinHttpSendRequest@28 +WinHttpSetCredentials@24 +WinHttpSetDefaultProxyConfiguration@4 +WinHttpSetOption@16 +WinHttpSetStatusCallback@16 +WinHttpSetTimeouts@20 +WinHttpTimeFromSystemTime@8 +WinHttpTimeToSystemTime@8 +WinHttpWriteData@16 diff -Nru libgit2-0.22.2/deps/winhttp/winhttp.h libgit2-0.23.1/deps/winhttp/winhttp.h --- libgit2-0.22.2/deps/winhttp/winhttp.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/deps/winhttp/winhttp.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,592 @@ +/* + * Copyright (C) 2007 Francois Gouget + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#if defined(__MINGW_VERSION) || defined(__MINGW32_VERSION) + +#ifndef __WINE_WINHTTP_H +#define __WINE_WINHTTP_H + +#ifdef _WIN64 +#include +#else +#include +#endif + +#define WINHTTPAPI +#define BOOLAPI WINHTTPAPI BOOL WINAPI + + +typedef LPVOID HINTERNET; +typedef HINTERNET *LPHINTERNET; + +#define INTERNET_DEFAULT_PORT 0 +#define INTERNET_DEFAULT_HTTP_PORT 80 +#define INTERNET_DEFAULT_HTTPS_PORT 443 +typedef WORD INTERNET_PORT; +typedef INTERNET_PORT *LPINTERNET_PORT; + +#define INTERNET_SCHEME_HTTP 1 +#define INTERNET_SCHEME_HTTPS 2 +typedef int INTERNET_SCHEME, *LPINTERNET_SCHEME; + +#define ICU_ESCAPE 0x80000000 + +/* flags for WinHttpOpen */ +#define WINHTTP_FLAG_ASYNC 0x10000000 + +/* flags for WinHttpOpenRequest */ +#define WINHTTP_FLAG_ESCAPE_PERCENT 0x00000004 +#define WINHTTP_FLAG_NULL_CODEPAGE 0x00000008 +#define WINHTTP_FLAG_ESCAPE_DISABLE 0x00000040 +#define WINHTTP_FLAG_ESCAPE_DISABLE_QUERY 0x00000080 +#define WINHTTP_FLAG_BYPASS_PROXY_CACHE 0x00000100 +#define WINHTTP_FLAG_REFRESH WINHTTP_FLAG_BYPASS_PROXY_CACHE +#define WINHTTP_FLAG_SECURE 0x00800000 + +#define WINHTTP_ACCESS_TYPE_DEFAULT_PROXY 0 +#define WINHTTP_ACCESS_TYPE_NO_PROXY 1 +#define WINHTTP_ACCESS_TYPE_NAMED_PROXY 3 + +#define WINHTTP_NO_PROXY_NAME NULL +#define WINHTTP_NO_PROXY_BYPASS NULL + +#define WINHTTP_NO_REFERER NULL +#define WINHTTP_DEFAULT_ACCEPT_TYPES NULL + +#define WINHTTP_NO_ADDITIONAL_HEADERS NULL +#define WINHTTP_NO_REQUEST_DATA NULL + +#define WINHTTP_HEADER_NAME_BY_INDEX NULL +#define WINHTTP_NO_OUTPUT_BUFFER NULL +#define WINHTTP_NO_HEADER_INDEX NULL + +#define WINHTTP_ADDREQ_INDEX_MASK 0x0000FFFF +#define WINHTTP_ADDREQ_FLAGS_MASK 0xFFFF0000 +#define WINHTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000 +#define WINHTTP_ADDREQ_FLAG_ADD 0x20000000 +#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000 +#define WINHTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000 +#define WINHTTP_ADDREQ_FLAG_COALESCE WINHTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA +#define WINHTTP_ADDREQ_FLAG_REPLACE 0x80000000 + +#define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0 + +/* flags for WinHttp{Set/Query}Options */ +#define WINHTTP_FIRST_OPTION WINHTTP_OPTION_CALLBACK +#define WINHTTP_OPTION_CALLBACK 1 +#define WINHTTP_OPTION_RESOLVE_TIMEOUT 2 +#define WINHTTP_OPTION_CONNECT_TIMEOUT 3 +#define WINHTTP_OPTION_CONNECT_RETRIES 4 +#define WINHTTP_OPTION_SEND_TIMEOUT 5 +#define WINHTTP_OPTION_RECEIVE_TIMEOUT 6 +#define WINHTTP_OPTION_RECEIVE_RESPONSE_TIMEOUT 7 +#define WINHTTP_OPTION_HANDLE_TYPE 9 +#define WINHTTP_OPTION_READ_BUFFER_SIZE 12 +#define WINHTTP_OPTION_WRITE_BUFFER_SIZE 13 +#define WINHTTP_OPTION_PARENT_HANDLE 21 +#define WINHTTP_OPTION_EXTENDED_ERROR 24 +#define WINHTTP_OPTION_SECURITY_FLAGS 31 +#define WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT 32 +#define WINHTTP_OPTION_URL 34 +#define WINHTTP_OPTION_SECURITY_KEY_BITNESS 36 +#define WINHTTP_OPTION_PROXY 38 +#define WINHTTP_OPTION_USER_AGENT 41 +#define WINHTTP_OPTION_CONTEXT_VALUE 45 +#define WINHTTP_OPTION_CLIENT_CERT_CONTEXT 47 +#define WINHTTP_OPTION_REQUEST_PRIORITY 58 +#define WINHTTP_OPTION_HTTP_VERSION 59 +#define WINHTTP_OPTION_DISABLE_FEATURE 63 +#define WINHTTP_OPTION_CODEPAGE 68 +#define WINHTTP_OPTION_MAX_CONNS_PER_SERVER 73 +#define WINHTTP_OPTION_MAX_CONNS_PER_1_0_SERVER 74 +#define WINHTTP_OPTION_AUTOLOGON_POLICY 77 +#define WINHTTP_OPTION_SERVER_CERT_CONTEXT 78 +#define WINHTTP_OPTION_ENABLE_FEATURE 79 +#define WINHTTP_OPTION_WORKER_THREAD_COUNT 80 +#define WINHTTP_OPTION_PASSPORT_COBRANDING_TEXT 81 +#define WINHTTP_OPTION_PASSPORT_COBRANDING_URL 82 +#define WINHTTP_OPTION_CONFIGURE_PASSPORT_AUTH 83 +#define WINHTTP_OPTION_SECURE_PROTOCOLS 84 +#define WINHTTP_OPTION_ENABLETRACING 85 +#define WINHTTP_OPTION_PASSPORT_SIGN_OUT 86 +#define WINHTTP_OPTION_PASSPORT_RETURN_URL 87 +#define WINHTTP_OPTION_REDIRECT_POLICY 88 +#define WINHTTP_OPTION_MAX_HTTP_AUTOMATIC_REDIRECTS 89 +#define WINHTTP_OPTION_MAX_HTTP_STATUS_CONTINUE 90 +#define WINHTTP_OPTION_MAX_RESPONSE_HEADER_SIZE 91 +#define WINHTTP_OPTION_MAX_RESPONSE_DRAIN_SIZE 92 +#define WINHTTP_OPTION_CONNECTION_INFO 93 +#define WINHTTP_OPTION_CLIENT_CERT_ISSUER_LIST 94 +#define WINHTTP_OPTION_SPN 96 +#define WINHTTP_OPTION_GLOBAL_PROXY_CREDS 97 +#define WINHTTP_OPTION_GLOBAL_SERVER_CREDS 98 +#define WINHTTP_OPTION_UNLOAD_NOTIFY_EVENT 99 +#define WINHTTP_OPTION_REJECT_USERPWD_IN_URL 100 +#define WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS 101 +#define WINHTTP_LAST_OPTION WINHTTP_OPTION_USE_GLOBAL_SERVER_CREDENTIALS +#define WINHTTP_OPTION_USERNAME 0x1000 +#define WINHTTP_OPTION_PASSWORD 0x1001 +#define WINHTTP_OPTION_PROXY_USERNAME 0x1002 +#define WINHTTP_OPTION_PROXY_PASSWORD 0x1003 + +#define WINHTTP_CONNS_PER_SERVER_UNLIMITED 0xFFFFFFFF + +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM 0 +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_LOW 1 +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH 2 +#define WINHTTP_AUTOLOGON_SECURITY_LEVEL_DEFAULT WINHTTP_AUTOLOGON_SECURITY_LEVEL_MEDIUM + +#define WINHTTP_OPTION_REDIRECT_POLICY_NEVER 0 +#define WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP 1 +#define WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS 2 +#define WINHTTP_OPTION_REDIRECT_POLICY_LAST WINHTTP_OPTION_REDIRECT_POLICY_ALWAYS +#define WINHTTP_OPTION_REDIRECT_POLICY_DEFAULT WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP + +#define WINHTTP_DISABLE_PASSPORT_AUTH 0x00000000 +#define WINHTTP_ENABLE_PASSPORT_AUTH 0x10000000 +#define WINHTTP_DISABLE_PASSPORT_KEYRING 0x20000000 +#define WINHTTP_ENABLE_PASSPORT_KEYRING 0x40000000 + +#define WINHTTP_DISABLE_COOKIES 0x00000001 +#define WINHTTP_DISABLE_REDIRECTS 0x00000002 +#define WINHTTP_DISABLE_AUTHENTICATION 0x00000004 +#define WINHTTP_DISABLE_KEEP_ALIVE 0x00000008 +#define WINHTTP_ENABLE_SSL_REVOCATION 0x00000001 +#define WINHTTP_ENABLE_SSL_REVERT_IMPERSONATION 0x00000002 +#define WINHTTP_DISABLE_SPN_SERVER_PORT 0x00000000 +#define WINHTTP_ENABLE_SPN_SERVER_PORT 0x00000001 +#define WINHTTP_OPTION_SPN_MASK WINHTTP_ENABLE_SPN_SERVER_PORT + +/* Options for WinHttpOpenRequest */ +#define WINHTTP_NO_REFERER NULL +#define WINHTTP_DEFAULT_ACCEPT_TYPES NULL + +/* Options for WinHttpSendRequest */ +#define WINHTTP_NO_ADDITIONAL_HEADERS NULL +#define WINHTTP_NO_REQUEST_DATA NULL + +/* WinHTTP error codes */ +#define WINHTTP_ERROR_BASE 12000 +#define ERROR_WINHTTP_OUT_OF_HANDLES (WINHTTP_ERROR_BASE + 1) +#define ERROR_WINHTTP_TIMEOUT (WINHTTP_ERROR_BASE + 2) +#define ERROR_WINHTTP_INTERNAL_ERROR (WINHTTP_ERROR_BASE + 4) +#define ERROR_WINHTTP_INVALID_URL (WINHTTP_ERROR_BASE + 5) +#define ERROR_WINHTTP_UNRECOGNIZED_SCHEME (WINHTTP_ERROR_BASE + 6) +#define ERROR_WINHTTP_NAME_NOT_RESOLVED (WINHTTP_ERROR_BASE + 7) +#define ERROR_WINHTTP_INVALID_OPTION (WINHTTP_ERROR_BASE + 9) +#define ERROR_WINHTTP_OPTION_NOT_SETTABLE (WINHTTP_ERROR_BASE + 11) +#define ERROR_WINHTTP_SHUTDOWN (WINHTTP_ERROR_BASE + 12) +#define ERROR_WINHTTP_LOGIN_FAILURE (WINHTTP_ERROR_BASE + 15) +#define ERROR_WINHTTP_OPERATION_CANCELLED (WINHTTP_ERROR_BASE + 17) +#define ERROR_WINHTTP_INCORRECT_HANDLE_TYPE (WINHTTP_ERROR_BASE + 18) +#define ERROR_WINHTTP_INCORRECT_HANDLE_STATE (WINHTTP_ERROR_BASE + 19) +#define ERROR_WINHTTP_CANNOT_CONNECT (WINHTTP_ERROR_BASE + 29) +#define ERROR_WINHTTP_CONNECTION_ERROR (WINHTTP_ERROR_BASE + 30) +#define ERROR_WINHTTP_RESEND_REQUEST (WINHTTP_ERROR_BASE + 32) +#define ERROR_WINHTTP_SECURE_CERT_DATE_INVALID (WINHTTP_ERROR_BASE + 37) +#define ERROR_WINHTTP_SECURE_CERT_CN_INVALID (WINHTTP_ERROR_BASE + 38) +#define ERROR_WINHTTP_CLIENT_AUTH_CERT_NEEDED (WINHTTP_ERROR_BASE + 44) +#define ERROR_WINHTTP_SECURE_INVALID_CA (WINHTTP_ERROR_BASE + 45) +#define ERROR_WINHTTP_SECURE_CERT_REV_FAILED (WINHTTP_ERROR_BASE + 57) +#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_OPEN (WINHTTP_ERROR_BASE + 100) +#define ERROR_WINHTTP_CANNOT_CALL_BEFORE_SEND (WINHTTP_ERROR_BASE + 101) +#define ERROR_WINHTTP_CANNOT_CALL_AFTER_SEND (WINHTTP_ERROR_BASE + 102) +#define ERROR_WINHTTP_CANNOT_CALL_AFTER_OPEN (WINHTTP_ERROR_BASE + 103) +#define ERROR_WINHTTP_HEADER_NOT_FOUND (WINHTTP_ERROR_BASE + 150) +#define ERROR_WINHTTP_INVALID_SERVER_RESPONSE (WINHTTP_ERROR_BASE + 152) +#define ERROR_WINHTTP_INVALID_HEADER (WINHTTP_ERROR_BASE + 153) +#define ERROR_WINHTTP_INVALID_QUERY_REQUEST (WINHTTP_ERROR_BASE + 154) +#define ERROR_WINHTTP_HEADER_ALREADY_EXISTS (WINHTTP_ERROR_BASE + 155) +#define ERROR_WINHTTP_REDIRECT_FAILED (WINHTTP_ERROR_BASE + 156) +#define ERROR_WINHTTP_SECURE_CHANNEL_ERROR (WINHTTP_ERROR_BASE + 157) +#define ERROR_WINHTTP_BAD_AUTO_PROXY_SCRIPT (WINHTTP_ERROR_BASE + 166) +#define ERROR_WINHTTP_UNABLE_TO_DOWNLOAD_SCRIPT (WINHTTP_ERROR_BASE + 167) +#define ERROR_WINHTTP_SECURE_INVALID_CERT (WINHTTP_ERROR_BASE + 169) +#define ERROR_WINHTTP_SECURE_CERT_REVOKED (WINHTTP_ERROR_BASE + 170) +#define ERROR_WINHTTP_NOT_INITIALIZED (WINHTTP_ERROR_BASE + 172) +#define ERROR_WINHTTP_SECURE_FAILURE (WINHTTP_ERROR_BASE + 175) +#define ERROR_WINHTTP_AUTO_PROXY_SERVICE_ERROR (WINHTTP_ERROR_BASE + 178) +#define ERROR_WINHTTP_SECURE_CERT_WRONG_USAGE (WINHTTP_ERROR_BASE + 179) +#define ERROR_WINHTTP_AUTODETECTION_FAILED (WINHTTP_ERROR_BASE + 180) +#define ERROR_WINHTTP_HEADER_COUNT_EXCEEDED (WINHTTP_ERROR_BASE + 181) +#define ERROR_WINHTTP_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 182) +#define ERROR_WINHTTP_CHUNKED_ENCODING_HEADER_SIZE_OVERFLOW (WINHTTP_ERROR_BASE + 183) +#define ERROR_WINHTTP_RESPONSE_DRAIN_OVERFLOW (WINHTTP_ERROR_BASE + 184) +#define ERROR_WINHTTP_CLIENT_CERT_NO_PRIVATE_KEY (WINHTTP_ERROR_BASE + 185) +#define ERROR_WINHTTP_CLIENT_CERT_NO_ACCESS_PRIVATE_KEY (WINHTTP_ERROR_BASE + 186) +#define WINHTTP_ERROR_LAST (WINHTTP_ERROR_BASE + 186) + +/* WinHttp status codes */ +#define HTTP_STATUS_CONTINUE 100 +#define HTTP_STATUS_SWITCH_PROTOCOLS 101 +#define HTTP_STATUS_OK 200 +#define HTTP_STATUS_CREATED 201 +#define HTTP_STATUS_ACCEPTED 202 +#define HTTP_STATUS_PARTIAL 203 +#define HTTP_STATUS_NO_CONTENT 204 +#define HTTP_STATUS_RESET_CONTENT 205 +#define HTTP_STATUS_PARTIAL_CONTENT 206 +#define HTTP_STATUS_WEBDAV_MULTI_STATUS 207 +#define HTTP_STATUS_AMBIGUOUS 300 +#define HTTP_STATUS_MOVED 301 +#define HTTP_STATUS_REDIRECT 302 +#define HTTP_STATUS_REDIRECT_METHOD 303 +#define HTTP_STATUS_NOT_MODIFIED 304 +#define HTTP_STATUS_USE_PROXY 305 +#define HTTP_STATUS_REDIRECT_KEEP_VERB 307 +#define HTTP_STATUS_BAD_REQUEST 400 +#define HTTP_STATUS_DENIED 401 +#define HTTP_STATUS_PAYMENT_REQ 402 +#define HTTP_STATUS_FORBIDDEN 403 +#define HTTP_STATUS_NOT_FOUND 404 +#define HTTP_STATUS_BAD_METHOD 405 +#define HTTP_STATUS_NONE_ACCEPTABLE 406 +#define HTTP_STATUS_PROXY_AUTH_REQ 407 +#define HTTP_STATUS_REQUEST_TIMEOUT 408 +#define HTTP_STATUS_CONFLICT 409 +#define HTTP_STATUS_GONE 410 +#define HTTP_STATUS_LENGTH_REQUIRED 411 +#define HTTP_STATUS_PRECOND_FAILED 412 +#define HTTP_STATUS_REQUEST_TOO_LARGE 413 +#define HTTP_STATUS_URI_TOO_LONG 414 +#define HTTP_STATUS_UNSUPPORTED_MEDIA 415 +#define HTTP_STATUS_RETRY_WITH 449 +#define HTTP_STATUS_SERVER_ERROR 500 +#define HTTP_STATUS_NOT_SUPPORTED 501 +#define HTTP_STATUS_BAD_GATEWAY 502 +#define HTTP_STATUS_SERVICE_UNAVAIL 503 +#define HTTP_STATUS_GATEWAY_TIMEOUT 504 +#define HTTP_STATUS_VERSION_NOT_SUP 505 +#define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE +#define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP + +#define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100 +#define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 +#define SECURITY_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 +#define SECURITY_FLAG_IGNORE_CERT_WRONG_USAGE 0x00000200 +#define SECURITY_FLAG_SECURE 0x00000001 +#define SECURITY_FLAG_STRENGTH_WEAK 0x10000000 +#define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000 +#define SECURITY_FLAG_STRENGTH_STRONG 0x20000000 + +#define ICU_NO_ENCODE 0x20000000 +#define ICU_DECODE 0x10000000 +#define ICU_NO_META 0x08000000 +#define ICU_ENCODE_SPACES_ONLY 0x04000000 +#define ICU_BROWSER_MODE 0x02000000 +#define ICU_ENCODE_PERCENT 0x00001000 + +/* Query flags */ +#define WINHTTP_QUERY_MIME_VERSION 0 +#define WINHTTP_QUERY_CONTENT_TYPE 1 +#define WINHTTP_QUERY_CONTENT_TRANSFER_ENCODING 2 +#define WINHTTP_QUERY_CONTENT_ID 3 +#define WINHTTP_QUERY_CONTENT_DESCRIPTION 4 +#define WINHTTP_QUERY_CONTENT_LENGTH 5 +#define WINHTTP_QUERY_CONTENT_LANGUAGE 6 +#define WINHTTP_QUERY_ALLOW 7 +#define WINHTTP_QUERY_PUBLIC 8 +#define WINHTTP_QUERY_DATE 9 +#define WINHTTP_QUERY_EXPIRES 10 +#define WINHTTP_QUERY_LAST_MODIFIED 11 +#define WINHTTP_QUERY_MESSAGE_ID 12 +#define WINHTTP_QUERY_URI 13 +#define WINHTTP_QUERY_DERIVED_FROM 14 +#define WINHTTP_QUERY_COST 15 +#define WINHTTP_QUERY_LINK 16 +#define WINHTTP_QUERY_PRAGMA 17 +#define WINHTTP_QUERY_VERSION 18 +#define WINHTTP_QUERY_STATUS_CODE 19 +#define WINHTTP_QUERY_STATUS_TEXT 20 +#define WINHTTP_QUERY_RAW_HEADERS 21 +#define WINHTTP_QUERY_RAW_HEADERS_CRLF 22 +#define WINHTTP_QUERY_CONNECTION 23 +#define WINHTTP_QUERY_ACCEPT 24 +#define WINHTTP_QUERY_ACCEPT_CHARSET 25 +#define WINHTTP_QUERY_ACCEPT_ENCODING 26 +#define WINHTTP_QUERY_ACCEPT_LANGUAGE 27 +#define WINHTTP_QUERY_AUTHORIZATION 28 +#define WINHTTP_QUERY_CONTENT_ENCODING 29 +#define WINHTTP_QUERY_FORWARDED 30 +#define WINHTTP_QUERY_FROM 31 +#define WINHTTP_QUERY_IF_MODIFIED_SINCE 32 +#define WINHTTP_QUERY_LOCATION 33 +#define WINHTTP_QUERY_ORIG_URI 34 +#define WINHTTP_QUERY_REFERER 35 +#define WINHTTP_QUERY_RETRY_AFTER 36 +#define WINHTTP_QUERY_SERVER 37 +#define WINHTTP_QUERY_TITLE 38 +#define WINHTTP_QUERY_USER_AGENT 39 +#define WINHTTP_QUERY_WWW_AUTHENTICATE 40 +#define WINHTTP_QUERY_PROXY_AUTHENTICATE 41 +#define WINHTTP_QUERY_ACCEPT_RANGES 42 +#define WINHTTP_QUERY_SET_COOKIE 43 +#define WINHTTP_QUERY_COOKIE 44 +#define WINHTTP_QUERY_REQUEST_METHOD 45 +#define WINHTTP_QUERY_REFRESH 46 +#define WINHTTP_QUERY_CONTENT_DISPOSITION 47 +#define WINHTTP_QUERY_AGE 48 +#define WINHTTP_QUERY_CACHE_CONTROL 49 +#define WINHTTP_QUERY_CONTENT_BASE 50 +#define WINHTTP_QUERY_CONTENT_LOCATION 51 +#define WINHTTP_QUERY_CONTENT_MD5 52 +#define WINHTTP_QUERY_CONTENT_RANGE 53 +#define WINHTTP_QUERY_ETAG 54 +#define WINHTTP_QUERY_HOST 55 +#define WINHTTP_QUERY_IF_MATCH 56 +#define WINHTTP_QUERY_IF_NONE_MATCH 57 +#define WINHTTP_QUERY_IF_RANGE 58 +#define WINHTTP_QUERY_IF_UNMODIFIED_SINCE 59 +#define WINHTTP_QUERY_MAX_FORWARDS 60 +#define WINHTTP_QUERY_PROXY_AUTHORIZATION 61 +#define WINHTTP_QUERY_RANGE 62 +#define WINHTTP_QUERY_TRANSFER_ENCODING 63 +#define WINHTTP_QUERY_UPGRADE 64 +#define WINHTTP_QUERY_VARY 65 +#define WINHTTP_QUERY_VIA 66 +#define WINHTTP_QUERY_WARNING 67 +#define WINHTTP_QUERY_EXPECT 68 +#define WINHTTP_QUERY_PROXY_CONNECTION 69 +#define WINHTTP_QUERY_UNLESS_MODIFIED_SINCE 70 +#define WINHTTP_QUERY_PROXY_SUPPORT 75 +#define WINHTTP_QUERY_AUTHENTICATION_INFO 76 +#define WINHTTP_QUERY_PASSPORT_URLS 77 +#define WINHTTP_QUERY_PASSPORT_CONFIG 78 +#define WINHTTP_QUERY_MAX 78 +#define WINHTTP_QUERY_CUSTOM 65535 +#define WINHTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000 +#define WINHTTP_QUERY_FLAG_SYSTEMTIME 0x40000000 +#define WINHTTP_QUERY_FLAG_NUMBER 0x20000000 + +/* Callback options */ +#define WINHTTP_CALLBACK_STATUS_RESOLVING_NAME 0x00000001 +#define WINHTTP_CALLBACK_STATUS_NAME_RESOLVED 0x00000002 +#define WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER 0x00000004 +#define WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER 0x00000008 +#define WINHTTP_CALLBACK_STATUS_SENDING_REQUEST 0x00000010 +#define WINHTTP_CALLBACK_STATUS_REQUEST_SENT 0x00000020 +#define WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE 0x00000040 +#define WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED 0x00000080 +#define WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION 0x00000100 +#define WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED 0x00000200 +#define WINHTTP_CALLBACK_STATUS_HANDLE_CREATED 0x00000400 +#define WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING 0x00000800 +#define WINHTTP_CALLBACK_STATUS_DETECTING_PROXY 0x00001000 +#define WINHTTP_CALLBACK_STATUS_REDIRECT 0x00004000 +#define WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE 0x00008000 +#define WINHTTP_CALLBACK_STATUS_SECURE_FAILURE 0x00010000 +#define WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE 0x00020000 +#define WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE 0x00040000 +#define WINHTTP_CALLBACK_STATUS_READ_COMPLETE 0x00080000 +#define WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE 0x00100000 +#define WINHTTP_CALLBACK_STATUS_REQUEST_ERROR 0x00200000 +#define WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE 0x00400000 +#define WINHTTP_CALLBACK_FLAG_RESOLVE_NAME (WINHTTP_CALLBACK_STATUS_RESOLVING_NAME | WINHTTP_CALLBACK_STATUS_NAME_RESOLVED) +#define WINHTTP_CALLBACK_FLAG_CONNECT_TO_SERVER (WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER | WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER) +#define WINHTTP_CALLBACK_FLAG_SEND_REQUEST (WINHTTP_CALLBACK_STATUS_SENDING_REQUEST | WINHTTP_CALLBACK_STATUS_REQUEST_SENT) +#define WINHTTP_CALLBACK_FLAG_RECEIVE_RESPONSE (WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE | WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED) +#define WINHTTP_CALLBACK_FLAG_CLOSE_CONNECTION (WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION | WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED) +#define WINHTTP_CALLBACK_FLAG_HANDLES (WINHTTP_CALLBACK_STATUS_HANDLE_CREATED | WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING) +#define WINHTTP_CALLBACK_FLAG_DETECTING_PROXY WINHTTP_CALLBACK_STATUS_DETECTING_PROXY +#define WINHTTP_CALLBACK_FLAG_REDIRECT WINHTTP_CALLBACK_STATUS_REDIRECT +#define WINHTTP_CALLBACK_FLAG_INTERMEDIATE_RESPONSE WINHTTP_CALLBACK_STATUS_INTERMEDIATE_RESPONSE +#define WINHTTP_CALLBACK_FLAG_SECURE_FAILURE WINHTTP_CALLBACK_STATUS_SECURE_FAILURE +#define WINHTTP_CALLBACK_FLAG_SENDREQUEST_COMPLETE WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE +#define WINHTTP_CALLBACK_FLAG_HEADERS_AVAILABLE WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE +#define WINHTTP_CALLBACK_FLAG_DATA_AVAILABLE WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE +#define WINHTTP_CALLBACK_FLAG_READ_COMPLETE WINHTTP_CALLBACK_STATUS_READ_COMPLETE +#define WINHTTP_CALLBACK_FLAG_WRITE_COMPLETE WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE +#define WINHTTP_CALLBACK_FLAG_REQUEST_ERROR WINHTTP_CALLBACK_STATUS_REQUEST_ERROR +#define WINHTTP_CALLBACK_FLAG_ALL_COMPLETIONS (WINHTTP_CALLBACK_STATUS_SENDREQUEST_COMPLETE | WINHTTP_CALLBACK_STATUS_HEADERS_AVAILABLE \ + | WINHTTP_CALLBACK_STATUS_DATA_AVAILABLE | WINHTTP_CALLBACK_STATUS_READ_COMPLETE \ + | WINHTTP_CALLBACK_STATUS_WRITE_COMPLETE | WINHTTP_CALLBACK_STATUS_REQUEST_ERROR) +#define WINHTTP_CALLBACK_FLAG_ALL_NOTIFICATIONS 0xffffffff +#define WINHTTP_INVALID_STATUS_CALLBACK ((WINHTTP_STATUS_CALLBACK)(-1)) + +#define API_RECEIVE_RESPONSE (1) +#define API_QUERY_DATA_AVAILABLE (2) +#define API_READ_DATA (3) +#define API_WRITE_DATA (4) +#define API_SEND_REQUEST (5) + +#define WINHTTP_HANDLE_TYPE_SESSION 1 +#define WINHTTP_HANDLE_TYPE_CONNECT 2 +#define WINHTTP_HANDLE_TYPE_REQUEST 3 + +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED 0x00000001 +#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT 0x00000002 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED 0x00000004 +#define WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA 0x00000008 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID 0x00000010 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID 0x00000020 +#define WINHTTP_CALLBACK_STATUS_FLAG_CERT_WRONG_USAGE 0x00000040 +#define WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR 0x80000000 + +#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 0x00000008 +#define WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 0x00000020 +#define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1 0x00000080 +#define WINHTTP_FLAG_SECURE_PROTOCOL_ALL (WINHTTP_FLAG_SECURE_PROTOCOL_SSL2 | WINHTTP_FLAG_SECURE_PROTOCOL_SSL3 | WINHTTP_FLAG_SECURE_PROTOCOL_TLS1) + +#define WINHTTP_AUTH_SCHEME_BASIC 0x00000001 +#define WINHTTP_AUTH_SCHEME_NTLM 0x00000002 +#define WINHTTP_AUTH_SCHEME_PASSPORT 0x00000004 +#define WINHTTP_AUTH_SCHEME_DIGEST 0x00000008 +#define WINHTTP_AUTH_SCHEME_NEGOTIATE 0x00000010 + +#define WINHTTP_AUTH_TARGET_SERVER 0x00000000 +#define WINHTTP_AUTH_TARGET_PROXY 0x00000001 + +#define WINHTTP_TIME_FORMAT_BUFSIZE 62 + +typedef struct +{ + DWORD dwStructSize; + LPWSTR lpszScheme; + DWORD dwSchemeLength; + INTERNET_SCHEME nScheme; + LPWSTR lpszHostName; + DWORD dwHostNameLength; + INTERNET_PORT nPort; + LPWSTR lpszUserName; + DWORD dwUserNameLength; + LPWSTR lpszPassword; + DWORD dwPasswordLength; + LPWSTR lpszUrlPath; + DWORD dwUrlPathLength; + LPWSTR lpszExtraInfo; + DWORD dwExtraInfoLength; +} URL_COMPONENTS, *LPURL_COMPONENTS; +typedef URL_COMPONENTS URL_COMPONENTSW; +typedef LPURL_COMPONENTS LPURL_COMPONENTSW; + +typedef struct +{ + DWORD_PTR dwResult; + DWORD dwError; +} WINHTTP_ASYNC_RESULT, *LPWINHTTP_ASYNC_RESULT; + +typedef struct +{ + FILETIME ftExpiry; + FILETIME ftStart; + LPWSTR lpszSubjectInfo; + LPWSTR lpszIssuerInfo; + LPWSTR lpszProtocolName; + LPWSTR lpszSignatureAlgName; + LPWSTR lpszEncryptionAlgName; + DWORD dwKeySize; +} WINHTTP_CERTIFICATE_INFO; + +typedef struct +{ + DWORD dwAccessType; + LPWSTR lpszProxy; + LPWSTR lpszProxyBypass; +} WINHTTP_PROXY_INFO, *LPWINHTTP_PROXY_INFO; +typedef WINHTTP_PROXY_INFO WINHTTP_PROXY_INFOW; +typedef LPWINHTTP_PROXY_INFO LPWINHTTP_PROXY_INFOW; + +typedef struct +{ + BOOL fAutoDetect; + LPWSTR lpszAutoConfigUrl; + LPWSTR lpszProxy; + LPWSTR lpszProxyBypass; +} WINHTTP_CURRENT_USER_IE_PROXY_CONFIG; + +typedef VOID (CALLBACK *WINHTTP_STATUS_CALLBACK)(HINTERNET,DWORD_PTR,DWORD,LPVOID,DWORD); + +#define WINHTTP_AUTO_DETECT_TYPE_DHCP 0x00000001 +#define WINHTTP_AUTO_DETECT_TYPE_DNS_A 0x00000002 + +#define WINHTTP_AUTOPROXY_AUTO_DETECT 0x00000001 +#define WINHTTP_AUTOPROXY_CONFIG_URL 0x00000002 +#define WINHTTP_AUTOPROXY_RUN_INPROCESS 0x00010000 +#define WINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY 0x00020000 + +typedef struct +{ + DWORD dwFlags; + DWORD dwAutoDetectFlags; + LPCWSTR lpszAutoConfigUrl; + LPVOID lpvReserved; + DWORD dwReserved; + BOOL fAutoLogonIfChallenged; +} WINHTTP_AUTOPROXY_OPTIONS; + +typedef struct +{ + DWORD dwMajorVersion; + DWORD dwMinorVersion; +} HTTP_VERSION_INFO, *LPHTTP_VERSION_INFO; + +#ifdef _WS2DEF_ +typedef struct +{ + DWORD cbSize; + SOCKADDR_STORAGE LocalAddress; + SOCKADDR_STORAGE RemoteAddress; +} WINHTTP_CONNECTION_INFO; +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +BOOL WINAPI WinHttpAddRequestHeaders(HINTERNET,LPCWSTR,DWORD,DWORD); +BOOL WINAPI WinHttpDetectAutoProxyConfigUrl(DWORD,LPWSTR*); +BOOL WINAPI WinHttpCheckPlatform(void); +BOOL WINAPI WinHttpCloseHandle(HINTERNET); +HINTERNET WINAPI WinHttpConnect(HINTERNET,LPCWSTR,INTERNET_PORT,DWORD); +BOOL WINAPI WinHttpCrackUrl(LPCWSTR,DWORD,DWORD,LPURL_COMPONENTS); +BOOL WINAPI WinHttpCreateUrl(LPURL_COMPONENTS,DWORD,LPWSTR,LPDWORD); +BOOL WINAPI WinHttpGetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*); +BOOL WINAPI WinHttpGetIEProxyConfigForCurrentUser(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*); +BOOL WINAPI WinHttpGetProxyForUrl(HINTERNET,LPCWSTR,WINHTTP_AUTOPROXY_OPTIONS*,WINHTTP_PROXY_INFO*); +HINTERNET WINAPI WinHttpOpen(LPCWSTR,DWORD,LPCWSTR,LPCWSTR,DWORD); +HINTERNET WINAPI WinHttpOpenRequest(HINTERNET,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR,LPCWSTR*,DWORD); +BOOL WINAPI WinHttpQueryAuthParams(HINTERNET,DWORD,LPVOID*); +BOOL WINAPI WinHttpQueryAuthSchemes(HINTERNET,LPDWORD,LPDWORD,LPDWORD); +BOOL WINAPI WinHttpQueryDataAvailable(HINTERNET,LPDWORD); +BOOL WINAPI WinHttpQueryHeaders(HINTERNET,DWORD,LPCWSTR,LPVOID,LPDWORD,LPDWORD); +BOOL WINAPI WinHttpQueryOption(HINTERNET,DWORD,LPVOID,LPDWORD); +BOOL WINAPI WinHttpReadData(HINTERNET,LPVOID,DWORD,LPDWORD); +BOOL WINAPI WinHttpReceiveResponse(HINTERNET,LPVOID); +BOOL WINAPI WinHttpSendRequest(HINTERNET,LPCWSTR,DWORD,LPVOID,DWORD,DWORD,DWORD_PTR); +BOOL WINAPI WinHttpSetDefaultProxyConfiguration(WINHTTP_PROXY_INFO*); +BOOL WINAPI WinHttpSetCredentials(HINTERNET,DWORD,DWORD,LPCWSTR,LPCWSTR,LPVOID); +BOOL WINAPI WinHttpSetOption(HINTERNET,DWORD,LPVOID,DWORD); +WINHTTP_STATUS_CALLBACK WINAPI WinHttpSetStatusCallback(HINTERNET,WINHTTP_STATUS_CALLBACK,DWORD,DWORD_PTR); +BOOL WINAPI WinHttpSetTimeouts(HINTERNET,int,int,int,int); +BOOL WINAPI WinHttpTimeFromSystemTime(const SYSTEMTIME *,LPWSTR); +BOOL WINAPI WinHttpTimeToSystemTime(LPCWSTR,SYSTEMTIME*); +BOOL WINAPI WinHttpWriteData(HINTERNET,LPCVOID,DWORD,LPDWORD); + +#ifdef __cplusplus +} +#endif + +#include + +#endif /* __WINE_WINHTTP_H */ + +#else + +#include_next + +#endif diff -Nru libgit2-0.22.2/examples/blame.c libgit2-0.23.1/examples/blame.c --- libgit2-0.22.2/examples/blame.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/blame.c 2015-08-03 18:07:35.000000000 +0000 @@ -37,8 +37,8 @@ int main(int argc, char *argv[]) { - int i, line, break_on_null_hunk; - size_t rawsize; + int line, break_on_null_hunk; + size_t i, rawsize; char spec[1024] = {0}; struct opts o = {0}; const char *rawdata; diff -Nru libgit2-0.22.2/examples/describe.c libgit2-0.23.1/examples/describe.c --- libgit2-0.22.2/examples/describe.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/describe.c 2015-08-03 18:07:35.000000000 +0000 @@ -13,6 +13,7 @@ */ #include "common.h" +#include /** * The following example partially reimplements the `git describe` command @@ -46,6 +47,27 @@ typedef struct args_info args_info; +static void *xrealloc(void *oldp, size_t newsz) +{ + void *p = realloc(oldp, newsz); + if (p == NULL) { + fprintf(stderr, "Cannot allocate memory, exiting.\n"); + exit(1); + } + return p; +} + +static void opts_add_commit(describe_options *opts, const char *commit) +{ + size_t sz; + + assert(opts != NULL); + + sz = ++opts->commit_count * sizeof(opts->commits[0]); + opts->commits = xrealloc(opts->commits, sz); + opts->commits[opts->commit_count - 1] = commit; +} + static void do_describe_single(git_repository *repo, describe_options *opts, const char *rev) { git_object *commit; @@ -96,8 +118,7 @@ const char *curr = argv[args.pos]; if (curr[0] != '-') { - opts->commits = (const char **)realloc((void *)opts->commits, ++opts->commit_count); - opts->commits[opts->commit_count - 1] = curr; + opts_add_commit(opts, curr); } else if (!strcmp(curr, "--all")) { opts->describe_options.describe_strategy = GIT_DESCRIBE_ALL; } else if (!strcmp(curr, "--tags")) { @@ -114,6 +135,8 @@ } else if (match_int_arg((int *)&opts->format_options.abbreviated_size, &args, "--abbrev", 0)) { } else if (match_int_arg((int *)&opts->describe_options.max_candidates_tags, &args, "--candidates", 0)) { } else if (match_str_arg(&opts->describe_options.pattern, &args, "--match")) { + } else { + print_usage(); } } @@ -123,8 +146,7 @@ } else { if (!opts->format_options.dirty_suffix || !opts->format_options.dirty_suffix[0]) { - opts->commits = (const char **)malloc(++opts->commit_count); - opts->commits[0] = "HEAD"; + opts_add_commit(opts, "HEAD"); } } } diff -Nru libgit2-0.22.2/examples/for-each-ref.c libgit2-0.23.1/examples/for-each-ref.c --- libgit2-0.22.2/examples/for-each-ref.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/for-each-ref.c 2015-08-03 18:07:35.000000000 +0000 @@ -34,6 +34,7 @@ int main(int argc, char **argv) { git_repository *repo; + git_libgit2_init(); if (argc != 1 || argv[1] /* silence -Wunused-parameter */) fatal("Sorry, no for-each-ref options supported yet", NULL); @@ -42,5 +43,7 @@ "Could not open repository", NULL); check_lg2(git_reference_foreach(repo, show_ref, repo), "Could not iterate over references", NULL); + + git_libgit2_shutdown(); return 0; } diff -Nru libgit2-0.22.2/examples/.gitignore libgit2-0.23.1/examples/.gitignore --- libgit2-0.22.2/examples/.gitignore 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/.gitignore 2015-08-03 18:07:35.000000000 +0000 @@ -7,7 +7,9 @@ init log rev-parse +remote status tag for-each-ref +describe *.dSYM diff -Nru libgit2-0.22.2/examples/Makefile libgit2-0.23.1/examples/Makefile --- libgit2-0.22.2/examples/Makefile 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/Makefile 2015-08-03 18:07:35.000000000 +0000 @@ -3,8 +3,9 @@ CC = gcc CFLAGS = -g -I../include -I../src -Wall -Wextra -Wmissing-prototypes -Wno-missing-field-initializers LFLAGS = -L../build -lgit2 -lz -APPS = general showindex diff rev-list cat-file status log rev-parse init blame tag +APPS = general showindex diff rev-list cat-file status log rev-parse init blame tag remote APPS += for-each-ref +APPS += describe all: $(APPS) diff -Nru libgit2-0.22.2/examples/network/clone.c libgit2-0.23.1/examples/network/clone.c --- libgit2-0.22.2/examples/network/clone.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/network/clone.c 2015-08-03 18:07:35.000000000 +0000 @@ -46,6 +46,15 @@ } } +static int sideband_progress(const char *str, int len, void *payload) +{ + (void)payload; // unused + + printf("remote: %*s", len, str); + fflush(stdout); + return 0; +} + static int fetch_progress(const git_transfer_progress *stats, void *payload) { progress_data *pd = (progress_data*)payload; @@ -82,13 +91,14 @@ } // Set up options - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; checkout_opts.progress_cb = checkout_progress; checkout_opts.progress_payload = &pd; clone_opts.checkout_opts = checkout_opts; - clone_opts.remote_callbacks.transfer_progress = &fetch_progress; - clone_opts.remote_callbacks.credentials = cred_acquire_cb; - clone_opts.remote_callbacks.payload = &pd; + clone_opts.fetch_opts.callbacks.sideband_progress = sideband_progress; + clone_opts.fetch_opts.callbacks.transfer_progress = &fetch_progress; + clone_opts.fetch_opts.callbacks.credentials = cred_acquire_cb; + clone_opts.fetch_opts.callbacks.payload = &pd; // Do the clone error = git_clone(&cloned_repo, url, path, &clone_opts); diff -Nru libgit2-0.22.2/examples/network/fetch.c libgit2-0.23.1/examples/network/fetch.c --- libgit2-0.22.2/examples/network/fetch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/network/fetch.c 2015-08-03 18:07:35.000000000 +0000 @@ -10,6 +10,7 @@ struct dl_data { git_remote *remote; + git_fetch_options *fetch_opts; int ret; int finished; }; @@ -28,7 +29,7 @@ // Connect to the remote end specifying that we want to fetch // information from it. - if (git_remote_connect(data->remote, GIT_DIRECTION_FETCH) < 0) { + if (git_remote_connect(data->remote, GIT_DIRECTION_FETCH, &data->fetch_opts->callbacks) < 0) { data->ret = -1; goto exit; } @@ -36,7 +37,7 @@ // Download the packfile and index it. This function updates the // amount of received data and the indexer stats which lets you // inform the user about progress. - if (git_remote_download(data->remote, NULL) < 0) { + if (git_remote_download(data->remote, NULL, data->fetch_opts) < 0) { data->ret = -1; goto exit; } @@ -78,7 +79,7 @@ git_remote *remote = NULL; const git_transfer_progress *stats; struct dl_data data; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; #ifndef _WIN32 pthread_t worker; #endif @@ -91,18 +92,18 @@ // Figure out whether it's a named remote or a URL printf("Fetching %s for repo %p\n", argv[1], repo); if (git_remote_lookup(&remote, repo, argv[1]) < 0) { - if (git_remote_create_anonymous(&remote, repo, argv[1], NULL) < 0) + if (git_remote_create_anonymous(&remote, repo, argv[1]) < 0) return -1; } // Set up the callbacks (only update_tips for now) - callbacks.update_tips = &update_cb; - callbacks.sideband_progress = &progress_cb; - callbacks.credentials = cred_acquire_cb; - git_remote_set_callbacks(remote, &callbacks); + fetch_opts.callbacks.update_tips = &update_cb; + fetch_opts.callbacks.sideband_progress = &progress_cb; + fetch_opts.callbacks.credentials = cred_acquire_cb; // Set up the information for the background worker thread data.remote = remote; + data.fetch_opts = &fetch_opts; data.ret = 0; data.finished = 0; @@ -142,10 +143,10 @@ * network. */ if (stats->local_objects > 0) { - printf("\rReceived %d/%d objects in %zu bytes (used %d local objects)\n", + printf("\rReceived %d/%d objects in %" PRIuZ " bytes (used %d local objects)\n", stats->indexed_objects, stats->total_objects, stats->received_bytes, stats->local_objects); } else{ - printf("\rReceived %d/%d objects in %zu bytes\n", + printf("\rReceived %d/%d objects in %" PRIuZ "bytes\n", stats->indexed_objects, stats->total_objects, stats->received_bytes); } @@ -156,7 +157,7 @@ // right commits. This may be needed even if there was no packfile // to download, which can happen e.g. when the branches have been // changed but all the needed objects are available locally. - if (git_remote_update_tips(remote, NULL, NULL) < 0) + if (git_remote_update_tips(remote, &fetch_opts.callbacks, 1, fetch_opts.download_tags, NULL) < 0) return -1; git_remote_free(remote); diff -Nru libgit2-0.22.2/examples/network/git2.c libgit2-0.23.1/examples/network/git2.c --- libgit2-0.22.2/examples/network/git2.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/network/git2.c 2015-08-03 18:07:35.000000000 +0000 @@ -23,8 +23,8 @@ int error; git_repository *repo; -// Before running the actual command, create an instance of the local -// repository and pass it to the function. + // Before running the actual command, create an instance of the local + // repository and pass it to the function. error = git_repository_open(&repo, ".git"); if (error < 0) @@ -48,6 +48,7 @@ int main(int argc, char **argv) { int i; + int return_code = 1; if (argc < 2) { fprintf(stderr, "usage: %s [repo]\n", argv[0]); @@ -57,10 +58,16 @@ git_libgit2_init(); for (i = 0; commands[i].name != NULL; ++i) { - if (!strcmp(argv[1], commands[i].name)) - return run_command(commands[i].fn, --argc, ++argv); + if (!strcmp(argv[1], commands[i].name)) { + return_code = run_command(commands[i].fn, --argc, ++argv); + goto shutdown; + } } fprintf(stderr, "Command not found: %s\n", argv[1]); - return 1; + +shutdown: + git_libgit2_shutdown(); + + return return_code; } diff -Nru libgit2-0.22.2/examples/network/ls-remote.c libgit2-0.23.1/examples/network/ls-remote.c --- libgit2-0.22.2/examples/network/ls-remote.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/network/ls-remote.c 2015-08-03 18:07:35.000000000 +0000 @@ -15,7 +15,7 @@ // Find the remote by name error = git_remote_lookup(&remote, repo, name); if (error < 0) { - error = git_remote_create_anonymous(&remote, repo, name, NULL); + error = git_remote_create_anonymous(&remote, repo, name); if (error < 0) goto cleanup; } @@ -25,9 +25,8 @@ * each of the remote references. */ callbacks.credentials = cred_acquire_cb; - git_remote_set_callbacks(remote, &callbacks); - error = git_remote_connect(remote, GIT_DIRECTION_FETCH); + error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks); if (error < 0) goto cleanup; diff -Nru libgit2-0.22.2/examples/remote.c libgit2-0.23.1/examples/remote.c --- libgit2-0.22.2/examples/remote.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/examples/remote.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,269 @@ +/* + * libgit2 "remote" example - shows how to modify remotes for a repo + * + * 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 + * . + */ + +#include "common.h" + +/** + * This is a sample program that is similar to "git remote". See the + * documentation for that (try "git help remote") to understand what this + * program is emulating. + * + * This demonstrates using the libgit2 APIs to modify remotes of a repository. + */ + +enum subcmd { + subcmd_add, + subcmd_remove, + subcmd_rename, + subcmd_seturl, + subcmd_show, +}; + +struct opts { + enum subcmd cmd; + + /* for command-specific args */ + int argc; + char **argv; +}; + +static int cmd_add(git_repository *repo, struct opts *o); +static int cmd_remove(git_repository *repo, struct opts *o); +static int cmd_rename(git_repository *repo, struct opts *o); +static int cmd_seturl(git_repository *repo, struct opts *o); +static int cmd_show(git_repository *repo, struct opts *o); + +static void parse_subcmd( + struct opts *opt, int argc, char **argv); +static void usage(const char *msg, const char *arg); + +int main(int argc, char *argv[]) +{ + int retval = 0; + struct opts opt = {0}; + git_buf buf = GIT_BUF_INIT_CONST(NULL, 0); + git_repository *repo = NULL; + + parse_subcmd(&opt, argc, argv); + + git_libgit2_init(); + + check_lg2(git_repository_discover(&buf, ".", 0, NULL), + "Could not find repository", NULL); + + check_lg2(git_repository_open(&repo, buf.ptr), + "Could not open repository", NULL); + git_buf_free(&buf); + + switch (opt.cmd) + { + case subcmd_add: + retval = cmd_add(repo, &opt); + break; + case subcmd_remove: + retval = cmd_remove(repo, &opt); + break; + case subcmd_rename: + retval = cmd_rename(repo, &opt); + break; + case subcmd_seturl: + retval = cmd_seturl(repo, &opt); + break; + case subcmd_show: + retval = cmd_show(repo, &opt); + break; + } + + git_libgit2_shutdown(); + + return retval; +} + +static int cmd_add(git_repository *repo, struct opts *o) +{ + char *name, *url; + git_remote *remote = {0}; + + if (o->argc != 2) + usage("you need to specify a name and URL", NULL); + + name = o->argv[0]; + url = o->argv[1]; + + check_lg2(git_remote_create(&remote, repo, name, url), + "could not create remote", NULL); + + return 0; +} + +static int cmd_remove(git_repository *repo, struct opts *o) +{ + char *name; + + if (o->argc != 1) + usage("you need to specify a name", NULL); + + name = o->argv[0]; + + check_lg2(git_remote_delete(repo, name), + "could not delete remote", name); + + return 0; +} + +static int cmd_rename(git_repository *repo, struct opts *o) +{ + int i, retval; + char *old, *new; + git_strarray problems = {0}; + + if (o->argc != 2) + usage("you need to specify old and new remote name", NULL); + + old = o->argv[0]; + new = o->argv[1]; + + retval = git_remote_rename(&problems, repo, old, new); + if (!retval) + return 0; + + for (i = 0; i < (int) problems.count; i++) { + puts(problems.strings[0]); + } + + git_strarray_free(&problems); + + return retval; +} + +static int cmd_seturl(git_repository *repo, struct opts *o) +{ + int i, retval, push = 0; + char *name = NULL, *url = NULL; + + for (i = 0; i < o->argc; i++) { + char *arg = o->argv[i]; + + if (!strcmp(arg, "--push")) { + push = 1; + } else if (arg[0] != '-' && name == NULL) { + name = arg; + } else if (arg[0] != '-' && url == NULL) { + url = arg; + } else { + usage("invalid argument to set-url", arg); + } + } + + if (name == NULL || url == NULL) + usage("you need to specify remote and the new URL", NULL); + + if (push) + retval = git_remote_set_pushurl(repo, name, url); + else + retval = git_remote_set_url(repo, name, url); + + check_lg2(retval, "could not set URL", url); + + return 0; +} + +static int cmd_show(git_repository *repo, struct opts *o) +{ + int i; + const char *arg, *name, *fetch, *push; + int verbose = 0; + git_strarray remotes = {0}; + git_remote *remote = {0}; + + for (i = 0; i < o->argc; i++) { + arg = o->argv[i]; + + if (!strcmp(arg, "-v") || !strcmp(arg, "--verbose")) { + verbose = 1; + } + } + + check_lg2(git_remote_list(&remotes, repo), + "could not retrieve remotes", NULL); + + for (i = 0; i < (int) remotes.count; i++) { + name = remotes.strings[i]; + if (!verbose) { + puts(name); + continue; + } + + check_lg2(git_remote_lookup(&remote, repo, name), + "could not look up remote", name); + + fetch = git_remote_url(remote); + if (fetch) + printf("%s\t%s (fetch)\n", name, fetch); + push = git_remote_pushurl(remote); + /* use fetch URL if no distinct push URL has been set */ + push = push ? push : fetch; + if (push) + printf("%s\t%s (push)\n", name, push); + + git_remote_free(remote); + } + + git_strarray_free(&remotes); + + return 0; +} + +static void parse_subcmd( + struct opts *opt, int argc, char **argv) +{ + char *arg = argv[1]; + enum subcmd cmd = 0; + + if (argc < 2) + usage("no command specified", NULL); + + if (!strcmp(arg, "add")) { + cmd = subcmd_add; + } else if (!strcmp(arg, "remove")) { + cmd = subcmd_remove; + } else if (!strcmp(arg, "rename")) { + cmd = subcmd_rename; + } else if (!strcmp(arg, "set-url")) { + cmd = subcmd_seturl; + } else if (!strcmp(arg, "show")) { + cmd = subcmd_show; + } else { + usage("command is not valid", arg); + } + opt->cmd = cmd; + + opt->argc = argc - 2; /* executable and subcommand are removed */ + opt->argv = argv + 2; +} + +static void usage(const char *msg, const char *arg) +{ + fputs("usage: remote add \n", stderr); + fputs(" remote remove \n", stderr); + fputs(" remote rename \n", stderr); + fputs(" remote set-url [--push] \n", stderr); + fputs(" remote show [-v|--verbose]\n", stderr); + + if (msg && !arg) + fprintf(stderr, "\n%s\n", msg); + else if (msg && arg) + fprintf(stderr, "\n%s: %s\n", msg, arg); + exit(1); +} diff -Nru libgit2-0.22.2/examples/status.c libgit2-0.23.1/examples/status.c --- libgit2-0.22.2/examples/status.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/examples/status.c 2015-08-03 18:07:35.000000000 +0000 @@ -384,25 +384,19 @@ if (s->index_to_workdir && s->index_to_workdir->new_file.mode == GIT_FILEMODE_COMMIT) { - git_submodule *sm = NULL; unsigned int smstatus = 0; - if (!git_submodule_lookup( - &sm, repo, s->index_to_workdir->new_file.path)) { - - if (!git_submodule_status(&smstatus, sm)) { - if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED) - extra = " (new commits)"; - else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED) - extra = " (modified content)"; - else if (smstatus & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED) - extra = " (modified content)"; - else if (smstatus & GIT_SUBMODULE_STATUS_WD_UNTRACKED) - extra = " (untracked content)"; - } + if (!git_submodule_status(&smstatus, repo, s->index_to_workdir->new_file.path, + GIT_SUBMODULE_IGNORE_UNSPECIFIED)) { + if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED) + extra = " (new commits)"; + else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED) + extra = " (modified content)"; + else if (smstatus & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED) + extra = " (modified content)"; + else if (smstatus & GIT_SUBMODULE_STATUS_WD_UNTRACKED) + extra = " (untracked content)"; } - - git_submodule_free(sm); } /** diff -Nru libgit2-0.22.2/.gitattributes libgit2-0.23.1/.gitattributes --- libgit2-0.22.2/.gitattributes 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/.gitattributes 2015-08-03 18:07:35.000000000 +0000 @@ -1,2 +1 @@ -*.c eol=lf -*.h eol=lf +* text=auto diff -Nru libgit2-0.22.2/.gitignore libgit2-0.23.1/.gitignore --- libgit2-0.22.2/.gitignore 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/.gitignore 2015-08-03 18:07:35.000000000 +0000 @@ -28,5 +28,6 @@ !cmake/Modules/*.cmake .DS_Store *~ +.*.swp tags mkmf.log diff -Nru libgit2-0.22.2/include/git2/annotated_commit.h libgit2-0.23.1/include/git2/annotated_commit.h --- libgit2-0.22.2/include/git2/annotated_commit.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/annotated_commit.h 2015-08-03 18:07:35.000000000 +0000 @@ -44,7 +44,7 @@ * @param repo repository that contains the given commit * @param branch_name name of the (remote) branch * @param remote_url url of the remote - * @param oid the commit object id of the remote branch + * @param id the commit object id of the remote branch * @return 0 on success or error code */ GIT_EXTERN(int) git_annotated_commit_from_fetchhead( @@ -78,9 +78,26 @@ const git_oid *id); /** + * Creates a `git_annotated_comit` from a revision string. + * + * See `man gitrevisions`, or + * http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for + * information on the syntax accepted. + * + * @param out pointer to store the git_annotated_commit result in + * @param repo repository that contains the given commit + * @param revspec the extended sha syntax string to use to lookup the commit + * @return 0 on success or error code + */ +GIT_EXTERN(int) git_annotated_commit_from_revspec( + git_annotated_commit **out, + git_repository *repo, + const char *revspec); + +/** * Gets the commit ID that the given `git_annotated_commit` refers to. * - * @param head the given annotated commit + * @param commit the given annotated commit * @return commit id */ GIT_EXTERN(const git_oid *) git_annotated_commit_id( @@ -89,7 +106,7 @@ /** * Frees a `git_annotated_commit`. * - * @param annotated_commit annotated commit to free + * @param commit annotated commit to free */ GIT_EXTERN(void) git_annotated_commit_free( git_annotated_commit *commit); diff -Nru libgit2-0.22.2/include/git2/blob.h libgit2-0.23.1/include/git2/blob.h --- libgit2-0.22.2/include/git2/blob.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/blob.h 2015-08-03 18:07:35.000000000 +0000 @@ -107,12 +107,10 @@ * The output is written into a `git_buf` which the caller must free * when done (via `git_buf_free`). * - * If no filters need to be applied, then the `out` buffer will just be - * populated with a pointer to the raw content of the blob. In that case, - * be careful to *not* free the blob until done with the buffer. To keep - * the data detached from the blob, call `git_buf_grow` on the buffer - * with a `want_size` of 0 and the buffer will be reallocated to be - * detached from the blob. + * If no filters need to be applied, then the `out` buffer will just + * be populated with a pointer to the raw content of the blob. In + * that case, be careful to *not* free the blob until done with the + * buffer or copy it into memory you own. * * @param out The git_buf to be filled in * @param blob Pointer to the blob diff -Nru libgit2-0.22.2/include/git2/branch.h libgit2-0.23.1/include/git2/branch.h --- libgit2-0.22.2/include/git2/branch.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/branch.h 2015-08-03 18:07:35.000000000 +0000 @@ -43,12 +43,6 @@ * * @param force Overwrite existing branch. * - * @param signature The identity that will used to populate the reflog entry - * - * @param log_message The one line long message to be appended to the reflog. - * If NULL, the default is "Branch: created"; if you want something more - * useful, provide a message. - * * @return 0, GIT_EINVALIDSPEC or an error code. * A proper reference is written in the refs/heads namespace * pointing to the provided target commit. @@ -58,9 +52,25 @@ git_repository *repo, const char *branch_name, const git_commit *target, - int force, - const git_signature *signature, - const char *log_message); + int force); + +/** + * Create a new branch pointing at a target commit + * + * This behaves like `git_branch_create()` but takes an annotated + * commit, which lets you specify which extended sha syntax string was + * specified by a user, allowing for more exact reflog messages. + * + * See the documentation for `git_branch_create()`. + * + * @see git_branch_create + */ +GIT_EXTERN(int) git_branch_create_from_annotated( + git_reference **ref_out, + git_repository *repository, + const char *branch_name, + const git_annotated_commit *commit, + int force); /** * Delete an existing branch reference. @@ -123,19 +133,13 @@ * * @param force Overwrite existing branch. * - * @param signature The identity that will used to populate the reflog entry - * - * @param log_message The one line long message to be appended to the reflog - * * @return 0 on success, GIT_EINVALIDSPEC or an error code. */ GIT_EXTERN(int) git_branch_move( git_reference **out, git_reference *branch, const char *new_branch_name, - int force, - const git_signature *signature, - const char *log_message); + int force); /** * Lookup a branch by its name in a repository. diff -Nru libgit2-0.22.2/include/git2/checkout.h libgit2-0.23.1/include/git2/checkout.h --- libgit2-0.22.2/include/git2/checkout.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/checkout.h 2015-08-03 18:07:35.000000000 +0000 @@ -31,7 +31,7 @@ * check out, the "baseline" tree of what was checked out previously, the * working directory for actual files, and the index for staged changes. * - * You give checkout one of four strategies for update: + * You give checkout one of three strategies for update: * * - `GIT_CHECKOUT_NONE` is a dry-run strategy that checks for conflicts, * etc., but doesn't make any actual changes. @@ -40,8 +40,8 @@ * make the working directory match the target (including potentially * discarding modified files). * - * In between those are `GIT_CHECKOUT_SAFE` and `GIT_CHECKOUT_SAFE_CREATE` - * both of which only make modifications that will not lose changes. + * - `GIT_CHECKOUT_SAFE` is between these two options, it will only make + * modifications that will not lose changes. * * | target == baseline | target != baseline | * ---------------------|-----------------------|----------------------| @@ -51,28 +51,21 @@ * workdir exists and | no action | conflict (notify | * is != baseline | notify dirty MODIFIED | and cancel checkout) | * ---------------------|-----------------------|----------------------| - * workdir missing, | create if SAFE_CREATE | create file | - * baseline present | notify dirty DELETED | | + * workdir missing, | notify dirty DELETED | create file | + * baseline present | | | * ---------------------|-----------------------|----------------------| * - * The only difference between SAFE and SAFE_CREATE is that SAFE_CREATE - * will cause a file to be checked out if it is missing from the working - * directory even if it is not modified between the target and baseline. - * - * * To emulate `git checkout`, use `GIT_CHECKOUT_SAFE` with a checkout * notification callback (see below) that displays information about dirty * files. The default behavior will cancel checkout on conflicts. * - * To emulate `git checkout-index`, use `GIT_CHECKOUT_SAFE_CREATE` with a + * To emulate `git checkout-index`, use `GIT_CHECKOUT_SAFE` with a * notification callback that cancels the operation if a dirty-but-existing * file is found in the working directory. This core git command isn't * quite "force" but is sensitive about some types of changes. * * To emulate `git checkout -f`, use `GIT_CHECKOUT_FORCE`. * - * To emulate `git clone` use `GIT_CHECKOUT_SAFE_CREATE` in the options. - * * * There are some additional flags to modified the behavior of checkout: * @@ -116,13 +109,13 @@ /** Allow safe updates that cannot overwrite uncommitted data */ GIT_CHECKOUT_SAFE = (1u << 0), - /** Allow safe updates plus creation of missing files */ - GIT_CHECKOUT_SAFE_CREATE = (1u << 1), - /** Allow all updates to force working directory to look like index */ - GIT_CHECKOUT_FORCE = (1u << 2), + GIT_CHECKOUT_FORCE = (1u << 1), + /** Allow checkout to recreate missing files */ + GIT_CHECKOUT_RECREATE_MISSING = (1u << 2), + /** Allow checkout to make safe updates even if conflicts are found */ GIT_CHECKOUT_ALLOW_CONFLICTS = (1u << 4), @@ -135,7 +128,10 @@ /** Only update existing files, don't create new ones */ GIT_CHECKOUT_UPDATE_ONLY = (1u << 7), - /** Normally checkout updates index entries as it goes; this stops that */ + /** + * Normally checkout updates index entries as it goes; this stops that. + * Implies `GIT_CHECKOUT_DONT_WRITE_INDEX`. + */ GIT_CHECKOUT_DONT_UPDATE_INDEX = (1u << 8), /** Don't refresh index/config/etc before doing checkout */ @@ -166,6 +162,9 @@ /** Don't overwrite existing files or folders */ GIT_CHECKOUT_DONT_REMOVE_EXISTING = (1u << 22), + /** Normally checkout writes the index upon completion; this prevents that. */ + GIT_CHECKOUT_DONT_WRITE_INDEX = (1u << 23), + /** * THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED */ @@ -214,6 +213,12 @@ GIT_CHECKOUT_NOTIFY_ALL = 0x0FFFFu } git_checkout_notify_t; +typedef struct { + size_t mkdir_calls; + size_t stat_calls; + size_t chmod_calls; +} git_checkout_perfdata; + /** Checkout notification callback function */ typedef int (*git_checkout_notify_cb)( git_checkout_notify_t why, @@ -230,6 +235,11 @@ size_t total_steps, void *payload); +/** Checkout perfdata notification function */ +typedef void (*git_checkout_perfdata_cb)( + const git_checkout_perfdata *perfdata, + void *payload); + /** * Checkout options structure * @@ -262,13 +272,26 @@ */ git_strarray paths; - git_tree *baseline; /**< expected content of workdir, defaults to HEAD */ + /** The expected content of the working directory; defaults to HEAD. + * If the working directory does not match this baseline information, + * that will produce a checkout conflict. + */ + git_tree *baseline; + + /** Like `baseline` above, though expressed as an index. This + * option overrides `baseline`. + */ + git_index *baseline_index; /**< expected content of workdir, expressed as an index. */ const char *target_directory; /**< alternative checkout path to workdir */ const char *ancestor_label; /**< the name of the common ancestor side of conflicts */ const char *our_label; /**< the name of the "our" side of conflicts */ const char *their_label; /**< the name of the "their" side of conflicts */ + + /** Optional callback to notify the consumer of performance data. */ + git_checkout_perfdata_cb perfdata_cb; + void *perfdata_payload; } git_checkout_options; #define GIT_CHECKOUT_OPTIONS_VERSION 1 diff -Nru libgit2-0.22.2/include/git2/cherrypick.h libgit2-0.23.1/include/git2/cherrypick.h --- libgit2-0.22.2/include/git2/cherrypick.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/cherrypick.h 2015-08-03 18:07:35.000000000 +0000 @@ -29,8 +29,8 @@ /** For merge commits, the "mainline" is treated as the parent. */ unsigned int mainline; - git_merge_options merge_opts; /*< Options for the merging */ - git_checkout_options checkout_opts; /*< Options for the checkout */ + git_merge_options merge_opts; /**< Options for the merging */ + git_checkout_options checkout_opts; /**< Options for the checkout */ } git_cherrypick_options; #define GIT_CHERRYPICK_OPTIONS_VERSION 1 diff -Nru libgit2-0.22.2/include/git2/clone.h libgit2-0.23.1/include/git2/clone.h --- libgit2-0.22.2/include/git2/clone.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/clone.h 2015-08-03 18:07:35.000000000 +0000 @@ -106,20 +106,17 @@ /** * These options are passed to the checkout step. To disable * checkout, set the `checkout_strategy` to - * `GIT_CHECKOUT_NONE`. Generally you will want the use - * GIT_CHECKOUT_SAFE_CREATE to create all files in the working - * directory for the newly cloned repository. + * `GIT_CHECKOUT_NONE`. */ git_checkout_options checkout_opts; /** - * Callbacks to use for reporting fetch progress, and for acquiring - * credentials in the event they are needed. This parameter is ignored if - * the remote_cb parameter is set; if you provide a remote creation - * callback, then you have the opportunity to configure remote callbacks in - * provided function. + * Options which control the fetch, including callbacks. + * + * The callbacks are used for reporting fetch progress, and for acquiring + * credentials in the event they are needed. */ - git_remote_callbacks remote_callbacks; + git_fetch_options fetch_opts; /** * Set to zero (false) to create a standard repo, or non-zero @@ -139,12 +136,6 @@ const char* checkout_branch; /** - * The identity used when updating the reflog. NULL means to - * use the default signature using the config. - */ - git_signature *signature; - - /** * A callback used to create the new repository into which to * clone. If NULL, the 'bare' field will be used to determine * whether to create a bare repository. @@ -173,7 +164,9 @@ } git_clone_options; #define GIT_CLONE_OPTIONS_VERSION 1 -#define GIT_CLONE_OPTIONS_INIT {GIT_CLONE_OPTIONS_VERSION, {GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE_CREATE}, GIT_REMOTE_CALLBACKS_INIT} +#define GIT_CLONE_OPTIONS_INIT { GIT_CLONE_OPTIONS_VERSION, \ + { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \ + GIT_FETCH_OPTIONS_INIT } /** * Initializes a `git_clone_options` with default values. Equivalent to diff -Nru libgit2-0.22.2/include/git2/commit.h libgit2-0.23.1/include/git2/commit.h --- libgit2-0.22.2/include/git2/commit.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/commit.h 2015-08-03 18:07:35.000000000 +0000 @@ -240,6 +240,17 @@ unsigned int n); /** + * Get an arbitrary header field + * + * @param out the buffer to fill + * @param commit the commit to look in + * @param field the header field to return + * @return 0 on succeess, GIT_ENOTFOUND if the field does not exist, + * or an error code + */ +GIT_EXTERN(int) git_commit_header_field(git_buf *out, const git_commit *commit, const char *field); + +/** * Create new commit in the repository from a list of `git_object` pointers * * The message will **not** be cleaned up automatically. You can do that diff -Nru libgit2-0.22.2/include/git2/config.h libgit2-0.23.1/include/git2/config.h --- libgit2-0.22.2/include/git2/config.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/config.h 2015-08-03 18:07:35.000000000 +0000 @@ -58,12 +58,19 @@ /** * An entry in a configuration file */ -typedef struct { - const char *name; /*< Name of the entry (normalised) */ - const char *value; /*< String value of the entry */ - git_config_level_t level; /*< Which config file this was found in */ +typedef struct git_config_entry { + const char *name; /**< Name of the entry (normalised) */ + const char *value; /**< String value of the entry */ + git_config_level_t level; /**< Which config file this was found in */ + void (*free)(struct git_config_entry *entry); /**< Free function for this entry */ + void *payload; /**< Opaque value for the free function. Do not read or write */ } git_config_entry; +/** + * Free a config entry + */ +GIT_EXTERN(void) git_config_entry_free(git_config_entry *); + typedef int (*git_config_foreach_cb)(const git_config_entry *, void *); typedef struct git_config_iterator git_config_iterator; @@ -261,16 +268,15 @@ /** * Get the git_config_entry of a config variable. * - * The git_config_entry is owned by the config and should not be freed by the - * user. - + * Free the git_config_entry after use with `git_config_entry_free()`. + * * @param out pointer to the variable git_config_entry * @param cfg where to look for the variable * @param name the variable's name * @return 0 or an error code */ GIT_EXTERN(int) git_config_get_entry( - const git_config_entry **out, + git_config_entry **out, const git_config *cfg, const char *name); @@ -320,17 +326,35 @@ GIT_EXTERN(int) git_config_get_bool(int *out, const git_config *cfg, const char *name); /** + * Get the value of a path config variable. + * + * A leading '~' will be expanded to the global search path (which + * defaults to the user's home directory but can be overridden via + * `git_libgit2_opts()`. + * + * All config files will be looked into, in the order of their + * defined level. A higher level means a higher priority. The + * first occurrence of the variable will be returned here. + * + * @param out the buffer in which to store the result + * @param cfg where to look for the variable + * @param name the variable's name + * @return 0 or an error code + */ +GIT_EXTERN(int) git_config_get_path(git_buf *out, const git_config *cfg, const char *name); + +/** * Get the value of a string config variable. * - * The string is owned by the variable and should not be freed by the - * user. The pointer will be valid until the next operation on this - * config object. + * This function can only be used on snapshot config objects. The + * string is owned by the config and should not be freed by the + * user. The pointer will be valid until the config is freed. * * All config files will be looked into, in the order of their * defined level. A higher level means a higher priority. The * first occurrence of the variable will be returned here. * - * @param out pointer to the variable's value + * @param out pointer to the string * @param cfg where to look for the variable * @param name the variable's name * @return 0 or an error code @@ -338,6 +362,22 @@ GIT_EXTERN(int) git_config_get_string(const char **out, const git_config *cfg, const char *name); /** + * Get the value of a string config variable. + * + * The value of the config will be copied into the buffer. + * + * All config files will be looked into, in the order of their + * defined level. A higher level means a higher priority. The + * first occurrence of the variable will be returned here. + * + * @param out buffer in which to store the string + * @param cfg where to look for the variable + * @param name the variable's name + * @return 0 or an error code + */ +GIT_EXTERN(int) git_config_get_string_buf(git_buf *out, const git_config *cfg, const char *name); + +/** * Get each value of a multivar in a foreach callback * * The callback will be called on each variable found @@ -615,6 +655,20 @@ */ GIT_EXTERN(int) git_config_parse_int64(int64_t *out, const char *value); +/** + * Parse a string value as a path. + * + * A leading '~' will be expanded to the global search path (which + * defaults to the user's home directory but can be overridden via + * `git_libgit2_opts()`. + * + * If the value does not begin with a tilde, the input will be + * returned. + * + * @param out placae to store the result of parsing + * @param value the path to evaluate + */ +GIT_EXTERN(int) git_config_parse_path(git_buf *out, const char *value); /** * Perform an operation on each config variable in given config backend diff -Nru libgit2-0.22.2/include/git2/cred_helpers.h libgit2-0.23.1/include/git2/cred_helpers.h --- libgit2-0.22.2/include/git2/cred_helpers.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/cred_helpers.h 2015-08-03 18:07:35.000000000 +0000 @@ -22,8 +22,8 @@ * Payload for git_cred_stock_userpass_plaintext. */ typedef struct git_cred_userpass_payload { - char *username; - char *password; + const char *username; + const char *password; } git_cred_userpass_payload; diff -Nru libgit2-0.22.2/include/git2/describe.h libgit2-0.23.1/include/git2/describe.h --- libgit2-0.22.2/include/git2/describe.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/describe.h 2015-08-03 18:07:35.000000000 +0000 @@ -94,7 +94,7 @@ * If the workdir is dirty and this is set, this string will * be appended to the description string. */ - char *dirty_suffix; + const char *dirty_suffix; } git_describe_format_options; #define GIT_DESCRIBE_FORMAT_OPTIONS_VERSION 1 @@ -129,7 +129,7 @@ * worktree. After peforming describe on HEAD, a status is run and the * description is considered to be dirty if there are. * - * @param result pointer to store the result. You must free this once + * @param out pointer to store the result. You must free this once * you're done with it. * @param repo the repository in which to perform the describe * @param opts the lookup options @@ -142,9 +142,10 @@ /** * Print the describe result to a buffer * + * @param out The buffer to store the result * @param result the result from `git_describe_commit()` or * `git_describe_workdir()`. - * @param opt the formatting options + * @param opts the formatting options */ GIT_EXTERN(int) git_describe_format( git_buf *out, diff -Nru libgit2-0.22.2/include/git2/diff.h libgit2-0.23.1/include/git2/diff.h --- libgit2-0.22.2/include/git2/diff.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/diff.h 2015-08-03 18:07:35.000000000 +0000 @@ -124,6 +124,11 @@ /** Use case insensitive filename comparisons */ GIT_DIFF_IGNORE_CASE = (1u << 10), + /** May be combined with `GIT_DIFF_IGNORE_CASE` to specify that a file + * that has changed case will be returned as an add/delete pair. + */ + GIT_DIFF_INCLUDE_CASECHANGE = (1u << 11), + /** If the pathspec is set in the diff options, this flags means to * apply it as an exact match instead of as an fnmatch pattern. */ @@ -220,7 +225,8 @@ typedef enum { GIT_DIFF_FLAG_BINARY = (1u << 0), /**< file(s) treated as binary data */ GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */ - GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */ + GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */ + GIT_DIFF_FLAG_EXISTS = (1u << 3), /**< file exists at this side of the delta */ } git_diff_flag_t; /** @@ -234,16 +240,17 @@ * DELETED pairs). */ typedef enum { - GIT_DELTA_UNMODIFIED = 0, /**< no changes */ - GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */ - GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */ - GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */ - GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */ - GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */ - GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */ - GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */ - GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */ - GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */ + GIT_DELTA_UNMODIFIED = 0, /**< no changes */ + GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */ + GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */ + GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */ + GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */ + GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */ + GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */ + GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */ + GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */ + GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */ + GIT_DELTA_CONFLICTED = 10, /**< entry in the index is conflicted */ } git_delta_t; /** @@ -392,7 +399,7 @@ * `git_diff_options_init` programmatic initialization. */ #define GIT_DIFF_OPTIONS_INIT \ - {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_DEFAULT, {NULL,0}, NULL, NULL, 3} + {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, 3} /** * Initializes a `git_diff_options` with default values. Equivalent to @@ -419,6 +426,53 @@ void *payload); /** + * When producing a binary diff, the binary data returned will be + * either the deflated full ("literal") contents of the file, or + * the deflated binary delta between the two sides (whichever is + * smaller). + */ +typedef enum { + /** There is no binary delta. */ + GIT_DIFF_BINARY_NONE, + + /** The binary data is the literal contents of the file. */ + GIT_DIFF_BINARY_LITERAL, + + /** The binary data is the delta from one side to the other. */ + GIT_DIFF_BINARY_DELTA, +} git_diff_binary_t; + +/** The contents of one of the files in a binary diff. */ +typedef struct { + /** The type of binary data for this file. */ + git_diff_binary_t type; + + /** The binary data, deflated. */ + const char *data; + + /** The length of the binary data. */ + size_t datalen; + + /** The length of the binary data after inflation. */ + size_t inflatedlen; +} git_diff_binary_file; + +/** Structure describing the binary contents of a diff. */ +typedef struct { + git_diff_binary_file old_file; /**< The contents of the old file. */ + git_diff_binary_file new_file; /**< The contents of the new file. */ +} git_diff_binary; + +/** +* When iterating over a diff, callback that will be made for +* binary content within the diff. +*/ +typedef int(*git_diff_binary_cb)( + const git_diff_delta *delta, + const git_diff_binary *binary, + void *payload); + +/** * Structure describing a hunk of a diff. */ typedef struct { @@ -849,9 +903,9 @@ /** * Return the diff delta for an entry in the diff list. * - * The `git_delta` pointer points to internal data and you do not have - * to release it when you are done with it. It will go away when the - * `git_diff` (or any associated `git_patch`) goes away. + * The `git_diff_delta` pointer points to internal data and you do not + * have to release it when you are done with it. It will go away when + * the * `git_diff` (or any associated `git_patch`) goes away. * * Note that the flags on the delta related to whether it has binary * content or not may not be set if there are no attributes set for the @@ -890,6 +944,7 @@ * * @param diff A git_diff generated by one of the above functions. * @param file_cb Callback function to make per file in the diff. + * @param binary_cb Optional callback to make for binary files. * @param hunk_cb Optional callback to make per hunk of text diff. This * callback is called to describe a range of lines in the * diff. It will not be issued for binary files. @@ -902,6 +957,7 @@ GIT_EXTERN(int) git_diff_foreach( git_diff *diff, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload); @@ -977,6 +1033,7 @@ * @param new_as_path Treat new blob as if it had this filename; can be NULL * @param options Options for diff, or NULL for default options * @param file_cb Callback for "file"; made once if there is a diff; can be NULL + * @param binary_cb Callback for binary files; can be NULL * @param hunk_cb Callback for each hunk in diff; can be NULL * @param line_cb Callback for each line in diff; can be NULL * @param payload Payload passed to each callback function @@ -989,6 +1046,7 @@ const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload); @@ -1012,6 +1070,7 @@ * @param buffer_as_path Treat buffer as if it had this filename; can be NULL * @param options Options for diff, or NULL for default options * @param file_cb Callback for "file"; made once if there is a diff; can be NULL + * @param binary_cb Callback for binary files; can be NULL * @param hunk_cb Callback for each hunk in diff; can be NULL * @param line_cb Callback for each line in diff; can be NULL * @param payload Payload passed to each callback function @@ -1025,6 +1084,7 @@ const char *buffer_as_path, const git_diff_options *options, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload); @@ -1044,6 +1104,7 @@ * @param new_as_path Treat buffer as if it had this filename; can be NULL * @param options Options for diff, or NULL for default options * @param file_cb Callback for "file"; made once if there is a diff; can be NULL + * @param binary_cb Callback for binary files; can be NULL * @param hunk_cb Callback for each hunk in diff; can be NULL * @param line_cb Callback for each line in diff; can be NULL * @param payload Payload passed to each callback function @@ -1058,6 +1119,7 @@ const char *new_as_path, const git_diff_options *options, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload); diff -Nru libgit2-0.22.2/include/git2/errors.h libgit2-0.23.1/include/git2/errors.h --- libgit2-0.22.2/include/git2/errors.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/errors.h 2015-08-03 18:07:35.000000000 +0000 @@ -38,13 +38,17 @@ GIT_EUNMERGED = -10, /**< Merge in progress prevented operation */ GIT_ENONFASTFORWARD = -11, /**< Reference was not fast-forwardable */ GIT_EINVALIDSPEC = -12, /**< Name/ref spec was not in a valid format */ - GIT_EMERGECONFLICT = -13, /**< Merge conflicts prevented operation */ + GIT_ECONFLICT = -13, /**< Checkout conflicts prevented operation */ GIT_ELOCKED = -14, /**< Lock file prevented operation */ GIT_EMODIFIED = -15, /**< Reference value does not match expected */ GIT_EAUTH = -16, /**< Authentication error */ GIT_ECERTIFICATE = -17, /**< Server certificate is invalid */ GIT_EAPPLIED = -18, /**< Patch/merge has already been applied */ GIT_EPEEL = -19, /**< The requested peel operation is not possible */ + GIT_EEOF = -20, /**< Unexpected EOF */ + GIT_EINVALID = -21, /**< Invalid operation or input */ + GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */ + GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */ GIT_PASSTHROUGH = -30, /**< Internal only */ GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */ @@ -93,6 +97,7 @@ GITERR_CHERRYPICK, GITERR_DESCRIBE, GITERR_REBASE, + GITERR_FILESYSTEM } git_error_t; /** diff -Nru libgit2-0.22.2/include/git2/filter.h libgit2-0.23.1/include/git2/filter.h --- libgit2-0.22.2/include/git2/filter.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/filter.h 2015-08-03 18:07:35.000000000 +0000 @@ -39,9 +39,9 @@ * Filter option flags. */ typedef enum { - GIT_FILTER_OPT_DEFAULT = 0u, - GIT_FILTER_OPT_ALLOW_UNSAFE = (1u << 0), -} git_filter_opt_t; + GIT_FILTER_DEFAULT = 0u, + GIT_FILTER_ALLOW_UNSAFE = (1u << 0), +} git_filter_flag_t; /** * A filter that can transform file data @@ -83,7 +83,7 @@ * @param blob The blob to which the filter will be applied (if known) * @param path Relative path of the file to be filtered * @param mode Filtering direction (WT->ODB or ODB->WT) - * @param options Combination of `git_filter_opt_t` flags + * @param flags Combination of `git_filter_flag_t` flags * @return 0 on success (which could still return NULL if no filters are * needed for the requested file), <0 on error */ @@ -93,7 +93,23 @@ git_blob *blob, /* can be NULL */ const char *path, git_filter_mode_t mode, - uint32_t options); + uint32_t flags); + +/** + * Query the filter list to see if a given filter (by name) will run. + * The built-in filters "crlf" and "ident" can be queried, otherwise this + * is the name of the filter specified by the filter attribute. + * + * This will return 0 if the given filter is not in the list, or 1 if + * the filter will be applied. + * + * @param filters A loaded git_filter_list (or NULL) + * @param name The name of the filter to query + * @return 1 if the filter is in the list, 0 otherwise + */ +GIT_EXTERN(int) git_filter_list_contains( + git_filter_list *filters, + const char *name); /** * Apply filter list to a data buffer. @@ -121,7 +137,13 @@ git_buf *in); /** - * Apply filter list to the contents of a file on disk + * Apply a filter list to the contents of a file on disk + * + * @param out buffer into which to store the filtered file + * @param filters the list of filters to apply + * @param repo the repository in which to perform the filtering + * @param path the path of the file to filter, a relative path will be + * taken as relative to the workdir */ GIT_EXTERN(int) git_filter_list_apply_to_file( git_buf *out, @@ -130,7 +152,11 @@ const char *path); /** - * Apply filter list to the contents of a blob + * Apply a filter list to the contents of a blob + * + * @param out buffer into which to store the filtered file + * @param filters the list of filters to apply + * @param blob the blob to filter */ GIT_EXTERN(int) git_filter_list_apply_to_blob( git_buf *out, @@ -138,6 +164,45 @@ git_blob *blob); /** + * Apply a filter list to an arbitrary buffer as a stream + * + * @param filters the list of filters to apply + * @param data the buffer to filter + * @param target the stream into which the data will be written + */ +GIT_EXTERN(int) git_filter_list_stream_data( + git_filter_list *filters, + git_buf *data, + git_writestream *target); + +/** + * Apply a filter list to a file as a stream + * + * @param filters the list of filters to apply + * @param repo the repository in which to perform the filtering + * @param path the path of the file to filter, a relative path will be + * taken as relative to the workdir + * @param target the stream into which the data will be written + */ +GIT_EXTERN(int) git_filter_list_stream_file( + git_filter_list *filters, + git_repository *repo, + const char *path, + git_writestream *target); + +/** + * Apply a filter list to a blob as a stream + * + * @param filters the list of filters to apply + * @param blob the blob to filter + * @param target the stream into which the data will be written + */ +GIT_EXTERN(int) git_filter_list_stream_blob( + git_filter_list *filters, + git_blob *blob, + git_writestream *target); + +/** * Free a git_filter_list * * @param filters A git_filter_list created by `git_filter_list_load` diff -Nru libgit2-0.22.2/include/git2/index.h libgit2-0.23.1/include/git2/index.h --- libgit2-0.22.2/include/git2/index.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/index.h 2015-08-03 18:07:35.000000000 +0000 @@ -24,9 +24,9 @@ /** Time structure used in a git index entry */ typedef struct { - git_time_t seconds; + int32_t seconds; /* nsec should not be stored as time_t compatible */ - unsigned int nanoseconds; + uint32_t nanoseconds; } git_index_time; /** @@ -44,22 +44,27 @@ * accessed via the later `GIT_IDXENTRY_...` bitmasks below. Some of * these flags are read from and written to disk, but some are set aside * for in-memory only reference. + * + * Note that the time and size fields are truncated to 32 bits. This + * is enough to detect changes, which is enough for the index to + * function as a cache, but it should not be taken as an authoritative + * source for that data. */ typedef struct git_index_entry { git_index_time ctime; git_index_time mtime; - unsigned int dev; - unsigned int ino; - unsigned int mode; - unsigned int uid; - unsigned int gid; - git_off_t file_size; + uint32_t dev; + uint32_t ino; + uint32_t mode; + uint32_t uid; + uint32_t gid; + uint32_t file_size; git_oid id; - unsigned short flags; - unsigned short flags_extended; + uint16_t flags; + uint16_t flags_extended; const char *path; } git_index_entry; @@ -269,6 +274,18 @@ GIT_EXTERN(const char *) git_index_path(const git_index *index); /** + * Get the checksum of the index + * + * This checksum is the SHA-1 hash over the index file (except the + * last 20 bytes which are the checksum itself). In cases where the + * index does not exist on-disk, it will be zeroed out. + * + * @param index an existing index object + * @return a pointer to the checksum of the index + */ +GIT_EXTERN(const git_oid *) git_index_checksum(git_index *index); + +/** * Read a tree into the index file with stats * * The current index contents will be replaced by the specified tree. @@ -425,6 +442,15 @@ */ GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry); +/** + * Return whether the given index entry is a conflict (has a high stage + * entry). This is simply shorthand for `git_index_entry_stage > 0`. + * + * @param entry The entry + * @return 1 if the entry is a conflict entry, 0 otherwise + */ +GIT_EXTERN(int) git_index_entry_is_conflict(const git_index_entry *entry); + /**@}*/ /** @name Workdir Index Entry Functions @@ -457,6 +483,38 @@ GIT_EXTERN(int) git_index_add_bypath(git_index *index, const char *path); /** + * Add or update an index entry from a buffer in memory + * + * This method will create a blob in the repository that owns the + * index and then add the index entry to the index. The `path` of the + * entry represents the position of the blob relative to the + * repository's root folder. + * + * If a previous index entry exists that has the same path as the + * given 'entry', it will be replaced. Otherwise, the 'entry' will be + * added. The `id` and the `file_size` of the 'entry' are updated with the + * real value of the blob. + * + * This forces the file to be added to the index, not looking + * at gitignore rules. Those rules can be evaluated through + * the git_status APIs (in status.h) before calling this. + * + * If this file currently is the result of a merge conflict, this + * file will no longer be marked as conflicting. The data about + * the conflict will be moved to the "resolve undo" (REUC) section. + * + * @param index an existing index object + * @param entry filename to add + * @param buffer data to be written into the blob + * @param len length of the data + * @return 0 or an error code + */ +GIT_EXTERN(int) git_index_add_frombuffer( + git_index *index, + const git_index_entry *entry, + const void *buffer, size_t len); + +/** * Remove an index entry corresponding to a file on disk * * The file `path` must be relative to the repository's @@ -594,7 +652,8 @@ /**@{*/ /** - * Add or update index entries to represent a conflict + * Add or update index entries to represent a conflict. Any staged + * entries that exist at the given paths will be removed. * * The entries are the entries from the tree included in the merge. Any * entry may be null to indicate that that file was not present in the diff -Nru libgit2-0.22.2/include/git2/merge.h libgit2-0.23.1/include/git2/merge.h --- libgit2-0.22.2/include/git2/merge.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/merge.h 2015-08-03 18:07:35.000000000 +0000 @@ -63,7 +63,7 @@ /** * Flags for `git_merge_tree` options. A combination of these flags can be - * passed in via the `flags` value in the `git_merge_options`. + * passed in via the `tree_flags` value in the `git_merge_options`. */ typedef enum { /** @@ -125,6 +125,21 @@ /** Condense non-alphanumeric regions for simplified diff file */ GIT_MERGE_FILE_SIMPLIFY_ALNUM = (1 << 2), + + /** Ignore all whitespace */ + GIT_MERGE_FILE_IGNORE_WHITESPACE = (1 << 3), + + /** Ignore changes in amount of whitespace */ + GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE = (1 << 4), + + /** Ignore whitespace at end of line */ + GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL = (1 << 5), + + /** Use the "patience diff" algorithm */ + GIT_MERGE_FILE_DIFF_PATIENCE = (1 << 6), + + /** Take extra time to find minimal diff */ + GIT_MERGE_FILE_DIFF_MINIMAL = (1 << 7), } git_merge_file_flags_t; /** @@ -154,8 +169,8 @@ /** The file to favor in region conflicts. */ git_merge_file_favor_t favor; - /** Merge file flags. */ - git_merge_file_flags_t flags; + /** see `git_merge_file_flags_t` above */ + unsigned int flags; } git_merge_file_options; #define GIT_MERGE_FILE_OPTIONS_VERSION 1 @@ -205,7 +220,7 @@ */ typedef struct { unsigned int version; - git_merge_tree_flag_t flags; + git_merge_tree_flag_t tree_flags; /** * Similarity to consider a file renamed (default 50). If @@ -230,6 +245,9 @@ /** Flags for handling conflicting content. */ git_merge_file_favor_t file_favor; + + /** see `git_merge_file_flags_t` above */ + unsigned int file_flags; } git_merge_options; #define GIT_MERGE_OPTIONS_VERSION 1 diff -Nru libgit2-0.22.2/include/git2/notes.h libgit2-0.23.1/include/git2/notes.h --- libgit2-0.22.2/include/git2/notes.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/notes.h 2015-08-03 18:07:35.000000000 +0000 @@ -183,12 +183,12 @@ /** * Get the default notes reference for a repository * - * @param out Pointer to the default notes reference + * @param out buffer in which to store the name of the default notes reference * @param repo The Git repository * * @return 0 or an error code */ -GIT_EXTERN(int) git_note_default_ref(const char **out, git_repository *repo); +GIT_EXTERN(int) git_note_default_ref(git_buf *out, git_repository *repo); /** * Loop over all the notes within a specified namespace diff -Nru libgit2-0.22.2/include/git2/odb_backend.h libgit2-0.23.1/include/git2/odb_backend.h --- libgit2-0.22.2/include/git2/odb_backend.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/odb_backend.h 2015-08-03 18:07:35.000000000 +0000 @@ -86,8 +86,8 @@ unsigned int mode; void *hash_ctx; - size_t declared_size; - size_t received_bytes; + git_off_t declared_size; + git_off_t received_bytes; /** * Write at most `len` bytes into `buffer` and advance the stream. diff -Nru libgit2-0.22.2/include/git2/odb.h libgit2-0.23.1/include/git2/odb.h --- libgit2-0.22.2/include/git2/odb.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/odb.h 2015-08-03 18:07:35.000000000 +0000 @@ -247,7 +247,7 @@ * @param type type of the object that will be written * @return 0 if the stream was created; error code otherwise */ -GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, size_t size, git_otype type); +GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_off_t size, git_otype type); /** * Write to an odb stream diff -Nru libgit2-0.22.2/include/git2/oid.h libgit2-0.23.1/include/git2/oid.h --- libgit2-0.22.2/include/git2/oid.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/oid.h 2015-08-03 18:07:35.000000000 +0000 @@ -123,7 +123,7 @@ * will be stored in TLS (i.e. one buffer per thread) to allow for * concurrent calls of the function. * - * @param id the oid structure to format + * @param oid The oid structure to format * @return the c-string */ GIT_EXTERN(char *) git_oid_tostr_s(const git_oid *oid); diff -Nru libgit2-0.22.2/include/git2/pack.h libgit2-0.23.1/include/git2/pack.h --- libgit2-0.22.2/include/git2/pack.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/pack.h 2015-08-03 18:07:35.000000000 +0000 @@ -115,6 +115,31 @@ GIT_EXTERN(int) git_packbuilder_insert_commit(git_packbuilder *pb, const git_oid *id); /** + * Insert objects as given by the walk + * + * Those commits and all objects they reference will be inserted into + * the packbuilder. + * + * @param pb the packbuilder + * @param walk the revwalk to use to fill the packbuilder + * + * @return 0 or an error code + */ +GIT_EXTERN(int) git_packbuilder_insert_walk(git_packbuilder *pb, git_revwalk *walk); + +/** + * Recursively insert an object and its referenced objects + * + * Insert the object as well as any object it references. + * + * @param pb the packbuilder + * @param id the id of the root object to insert + * @param name optional name for the object + * @return 0 or an error code + */ +GIT_EXTERN(int) git_packbuilder_insert_recur(git_packbuilder *pb, const git_oid *id, const char *name); + +/** * Write the contents of the packfile to an in-memory buffer * * The contents of the buffer will become a valid packfile, even though there diff -Nru libgit2-0.22.2/include/git2/patch.h libgit2-0.23.1/include/git2/patch.h --- libgit2-0.22.2/include/git2/patch.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/patch.h 2015-08-03 18:07:35.000000000 +0000 @@ -29,7 +29,7 @@ typedef struct git_patch git_patch; /** - * Return the diff delta and patch for an entry in the diff list. + * Return a patch for an entry in the diff list. * * The `git_patch` is a newly created object contains the text diffs * for the delta. You have to call `git_patch_free()` when you are @@ -40,10 +40,6 @@ * created, the output will be set to NULL, and the `binary` flag will be * set true in the `git_diff_delta` structure. * - * The `git_diff_delta` pointer points to internal data and you do not have - * to release it when you are done with it. It will go away when the - * `git_diff` and `git_patch` go away. - * * It is okay to pass NULL for either of the output parameters; if you pass * NULL for the `git_patch`, then the text diff will not be calculated. * @@ -139,7 +135,8 @@ GIT_EXTERN(void) git_patch_free(git_patch *patch); /** - * Get the delta associated with a patch + * Get the delta associated with a patch. This delta points to internal + * data and you do not have to release it when you are done with it. */ GIT_EXTERN(const git_diff_delta *) git_patch_get_delta(const git_patch *patch); diff -Nru libgit2-0.22.2/include/git2/push.h libgit2-0.23.1/include/git2/push.h --- libgit2-0.22.2/include/git2/push.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/push.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (C) the libgit2 contributors. All rights reserved. - * - * This file is part of libgit2, distributed under the GNU GPL v2 with - * a Linking Exception. For full terms see the included COPYING file. - */ -#ifndef INCLUDE_git_push_h__ -#define INCLUDE_git_push_h__ - -#include "common.h" -#include "pack.h" - -/** - * @file git2/push.h - * @brief Git push management functions - * @defgroup git_push push management functions - * @ingroup Git - * @{ - */ -GIT_BEGIN_DECL - -/** - * Controls the behavior of a git_push object. - */ -typedef struct { - unsigned int version; - - /** - * If the transport being used to push to the remote requires the creation - * of a pack file, this controls the number of worker threads used by - * the packbuilder when creating that pack file to be sent to the remote. - * - * If set to 0, the packbuilder will auto-detect the number of threads - * to create. The default value is 1. - */ - unsigned int pb_parallelism; -} git_push_options; - -#define GIT_PUSH_OPTIONS_VERSION 1 -#define GIT_PUSH_OPTIONS_INIT { GIT_PUSH_OPTIONS_VERSION } - -/** - * Initializes a `git_push_options` with default values. Equivalent to - * creating an instance with GIT_PUSH_OPTIONS_INIT. - * - * @param opts the `git_push_options` instance to initialize. - * @param version the version of the struct; you should pass - * `GIT_PUSH_OPTIONS_VERSION` here. - * @return Zero on success; -1 on failure. - */ -GIT_EXTERN(int) git_push_init_options( - git_push_options *opts, - unsigned int version); - -/** Push network progress notification function */ -typedef int (*git_push_transfer_progress)( - unsigned int current, - unsigned int total, - size_t bytes, - void* payload); - -/** @} */ -GIT_END_DECL -#endif diff -Nru libgit2-0.22.2/include/git2/rebase.h libgit2-0.23.1/include/git2/rebase.h --- libgit2-0.22.2/include/git2/rebase.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/rebase.h 2015-08-03 18:07:35.000000000 +0000 @@ -30,19 +30,32 @@ unsigned int version; /** - * Provide a quiet rebase experience; unused by libgit2 but provided for - * interoperability with other clients. + * Used by `git_rebase_init`, this will instruct other clients working + * on this rebase that you want a quiet rebase experience, which they + * may choose to provide in an application-specific manner. This has no + * effect upon libgit2 directly, but is provided for interoperability + * between Git tools. */ int quiet; /** - * Canonical name of the notes reference used to rewrite notes for - * rebased commits when finishing the rebase; if NULL, the contents of - * the coniguration option `notes.rewriteRef` is examined, unless the - * configuration option `notes.rewrite.rebase` is set to false. If - * `notes.rewriteRef` is NULL, notes will not be rewritten. + * Used by `git_rebase_finish`, this is the name of the notes reference + * used to rewrite notes for rebased commits when finishing the rebase; + * if NULL, the contents of the coniguration option `notes.rewriteRef` + * is examined, unless the configuration option `notes.rewrite.rebase` + * is set to false. If `notes.rewriteRef` is also NULL, notes will + * not be rewritten. */ const char *rewrite_notes_ref; + + /** + * Options to control how files are written during `git_rebase_init`, + * `git_checkout_next` and `git_checkout_abort`. Note that a minimum + * strategy of `GIT_CHECKOUT_SAFE` is defaulted in `init` and `next`, + * and a minimum strategy of `GIT_CHECKOUT_FORCE` is defaulted in + * `abort` to match git semantics. + */ + git_checkout_options checkout_options; } git_rebase_options; /** @@ -87,7 +100,11 @@ } git_rebase_operation_t; #define GIT_REBASE_OPTIONS_VERSION 1 -#define GIT_REBASE_OPTIONS_INIT {GIT_REBASE_OPTIONS_VERSION} +#define GIT_REBASE_OPTIONS_INIT \ + {GIT_REBASE_OPTIONS_VERSION, 0, NULL, GIT_CHECKOUT_OPTIONS_INIT} + +/** Indicates that a rebase operation is not (yet) in progress. */ +#define GIT_REBASE_NO_OPERATION SIZE_MAX /** * A rebase operation @@ -133,13 +150,13 @@ * * @param out Pointer to store the rebase object * @param repo The repository to perform the rebase - * @param branch The terminal commit to rebase + * @param branch The terminal commit to rebase, or NULL to rebase the + * current branch * @param upstream The commit to begin rebasing from, or NULL to rebase all * reachable commits * @param onto The branch to rebase onto, or NULL to rebase onto the given * upstream - * @param signature The signature of the rebaser (optional) - * @param opts Options to specify how rebase is performed + * @param opts Options to specify how rebase is performed, or NULL * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_rebase_init( @@ -148,7 +165,6 @@ const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, - const git_signature *signature, const git_rebase_options *opts); /** @@ -156,10 +172,14 @@ * invocation of `git_rebase_init` or by another client. * * @param out Pointer to store the rebase object - * @param reop The repository that has a rebase in-progress + * @param repo The repository that has a rebase in-progress + * @param opts Options to specify how rebase is performed * @return Zero on success; -1 on failure. */ -GIT_EXTERN(int) git_rebase_open(git_rebase **out, git_repository *repo); +GIT_EXTERN(int) git_rebase_open( + git_rebase **out, + git_repository *repo, + const git_rebase_options *opts); /** * Gets the count of rebase operations that are to be applied. @@ -171,6 +191,9 @@ /** * Gets the index of the rebase operation that is currently being applied. + * If the first operation has not yet been applied (because you have + * called `init` but not yet `next`) then this returns + * `GIT_REBASE_NO_OPERATION`. * * @param rebase The in-progress rebase * @return The index of the rebase operation currently being applied. @@ -195,15 +218,13 @@ * working directory will be updated with the changes. If there are conflicts, * you will need to address those before committing the changes. * - * @param out Pointer to store the rebase operation that is to be performed next - * @param repo The rebase in progress - * @param checkout_opts Options to specify how the patch should be checked out + * @param operation Pointer to store the rebase operation that is to be performed next + * @param rebase The rebase in progress * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_rebase_next( git_rebase_operation **operation, - git_rebase *rebase, - git_checkout_options *checkout_opts); + git_rebase *rebase); /** * Commits the current patch. You must have resolved any conflicts that @@ -211,7 +232,7 @@ * invocation. * * @param id Pointer in which to store the OID of the newly created commit - * @param repo The rebase that is in-progress + * @param rebase The rebase that is in-progress * @param author The author of the updated commit, or NULL to keep the * author from the original commit * @param committer The committer of the rebase @@ -240,13 +261,10 @@ * and working directory to their state before rebase began. * * @param rebase The rebase that is in-progress - * @param signature The identity that is aborting the rebase * @return Zero on success; GIT_ENOTFOUND if a rebase is not in progress, * -1 on other errors. */ -GIT_EXTERN(int) git_rebase_abort( - git_rebase *rebase, - const git_signature *signature); +GIT_EXTERN(int) git_rebase_abort(git_rebase *rebase); /** * Finishes a rebase that is currently in progress once all patches have @@ -254,13 +272,11 @@ * * @param rebase The rebase that is in-progress * @param signature The identity that is finishing the rebase (optional) - * @param opts Options to specify how rebase is finished - * @param Zero on success; -1 on error + * @return Zero on success; -1 on error */ GIT_EXTERN(int) git_rebase_finish( git_rebase *rebase, - const git_signature *signature, - const git_rebase_options *opts); + const git_signature *signature); /** * Frees the `git_rebase` object. diff -Nru libgit2-0.22.2/include/git2/refs.h libgit2-0.23.1/include/git2/refs.h --- libgit2-0.22.2/include/git2/refs.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/refs.h 2015-08-03 18:07:35.000000000 +0000 @@ -89,9 +89,9 @@ * This function will return an error if a reference already exists with the * given name unless `force` is true, in which case it will be overwritten. * - * The signature and message for the reflog will be ignored if the - * reference does not belong in the standard set (HEAD, branches and - * remote-tracking branches) and it does not have a reflog. + * The message for the reflog will be ignored if the reference does + * not belong in the standard set (HEAD, branches and remote-tracking + * branches) and it does not have a reflog. * * It will return GIT_EMODIFIED if the reference's value at the time * of updating does not match the one passed through `current_value` @@ -103,11 +103,10 @@ * @param target The target of the reference * @param force Overwrite existing references * @param current_value The expected value of the reference when updating - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC, GIT_EMODIFIED or an error code */ -GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const git_signature *signature, const char *log_message); +GIT_EXTERN(int) git_reference_symbolic_create_matching(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *current_value, const char *log_message); /** * Create a new symbolic reference. @@ -131,20 +130,19 @@ * This function will return an error if a reference already exists with the * given name unless `force` is true, in which case it will be overwritten. * - * The signature and message for the reflog will be ignored if the - * reference does not belong in the standard set (HEAD, branches and - * remote-tracking branches) and it does not have a reflog. + * The message for the reflog will be ignored if the reference does + * not belong in the standard set (HEAD, branches and remote-tracking + * branches) and it does not have a reflog. * * @param out Pointer to the newly created reference * @param repo Repository where that reference will live * @param name The name of the reference * @param target The target of the reference * @param force Overwrite existing references - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code */ -GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const git_signature *signature, const char *log_message); +GIT_EXTERN(int) git_reference_symbolic_create(git_reference **out, git_repository *repo, const char *name, const char *target, int force, const char *log_message); /** * Create a new direct reference. @@ -169,20 +167,19 @@ * This function will return an error if a reference already exists with the * given name unless `force` is true, in which case it will be overwritten. * - * The signature and message for the reflog will be ignored if the - * reference does not belong in the standard set (HEAD, branches and - * remote-tracking branches) and and it does not have a reflog. + * The message for the reflog will be ignored if the reference does + * not belong in the standard set (HEAD, branches and remote-tracking + * branches) and and it does not have a reflog. * * @param out Pointer to the newly created reference * @param repo Repository where that reference will live * @param name The name of the reference * @param id The object id pointed to by the reference. * @param force Overwrite existing references - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code */ -GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_signature *signature, const char *log_message); +GIT_EXTERN(int) git_reference_create(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const char *log_message); /** * Conditionally create new direct reference @@ -207,9 +204,9 @@ * This function will return an error if a reference already exists with the * given name unless `force` is true, in which case it will be overwritten. * - * The signature and message for the reflog will be ignored if the - * reference does not belong in the standard set (HEAD, branches and - * remote-tracking branches) and and it does not have a reflog. + * The message for the reflog will be ignored if the reference does + * not belong in the standard set (HEAD, branches and remote-tracking + * branches) and and it does not have a reflog. * * It will return GIT_EMODIFIED if the reference's value at the time * of updating does not match the one passed through `current_id` @@ -221,12 +218,11 @@ * @param id The object id pointed to by the reference. * @param force Overwrite existing references * @param current_id The expected value of the reference at the time of update - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EMODIFIED if the value of the reference * has changed, GIT_EEXISTS, GIT_EINVALIDSPEC or an error code */ -GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const git_signature *signature, const char *log_message); +GIT_EXTERN(int) git_reference_create_matching(git_reference **out, git_repository *repo, const char *name, const git_oid *id, int force, const git_oid *current_id, const char *log_message); /** * Get the OID pointed to by a direct reference. @@ -320,14 +316,13 @@ * The target name will be checked for validity. * See `git_reference_symbolic_create()` for rules about valid names. * - * The signature and message for the reflog will be ignored if the - * reference does not belong in the standard set (HEAD, branches and - * remote-tracking branches) and and it does not have a reflog. + * The message for the reflog will be ignored if the reference does + * not belong in the standard set (HEAD, branches and remote-tracking + * branches) and and it does not have a reflog. * * @param out Pointer to the newly created reference * @param ref The reference * @param target The new target for the reference - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EINVALIDSPEC or an error code */ @@ -335,7 +330,6 @@ git_reference **out, git_reference *ref, const char *target, - const git_signature *signature, const char *log_message); /** @@ -348,7 +342,6 @@ * @param out Pointer to the newly created reference * @param ref The reference * @param id The new target OID for the reference - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EMODIFIED if the value of the reference * has changed since it was read, or an error code @@ -357,7 +350,6 @@ git_reference **out, git_reference *ref, const git_oid *id, - const git_signature *signature, const char *log_message); /** @@ -379,7 +371,6 @@ * @param ref The reference to rename * @param new_name The new name for the reference * @param force Overwrite an existing reference - * @param signature The identity that will used to populate the reflog entry * @param log_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code * @@ -389,7 +380,6 @@ git_reference *ref, const char *new_name, int force, - const git_signature *signature, const char *log_message); /** diff -Nru libgit2-0.22.2/include/git2/remote.h libgit2-0.23.1/include/git2/remote.h --- libgit2-0.22.2/include/git2/remote.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/remote.h 2015-08-03 18:07:35.000000000 +0000 @@ -14,7 +14,7 @@ #include "indexer.h" #include "strarray.h" #include "transport.h" -#include "push.h" +#include "pack.h" /** * @file git2/remote.h @@ -28,8 +28,7 @@ typedef int (*git_remote_rename_problem_cb)(const char *problematic_refspec, void *payload); /** - * Add a remote with the default fetch refspec to the repository's configuration. This - * calls git_remote_save before returning. + * Add a remote with the default fetch refspec to the repository's configuration. * * @param out the resulting remote * @param repo the repository in which to create the remote @@ -45,8 +44,7 @@ /** * Add a remote with the provided fetch refspec (or default if NULL) to the repository's - * configuration. This - * calls git_remote_save before returning. + * configuration. * * @param out the resulting remote * @param repo the repository in which to create the remote @@ -65,24 +63,18 @@ /** * Create an anonymous remote * - * Create a remote with the given url and refspec in memory. You can use - * this when you have a URL instead of a remote's name. Note that anonymous - * remotes cannot be converted to persisted remotes. + * Create a remote with the given url in-memory. You can use this when + * you have a URL instead of a remote's name. * - * The name, when provided, will be checked for validity. - * See `git_tag_create()` for rules about valid names. - * - * @param out pointer to the new remote object + * @param out pointer to the new remote objects * @param repo the associated repository * @param url the remote repository's URL - * @param fetch the fetch refspec to use for this remote. * @return 0 or an error code */ GIT_EXTERN(int) git_remote_create_anonymous( git_remote **out, git_repository *repo, - const char *url, - const char *fetch); + const char *url); /** * Get the information for a particular remote @@ -98,17 +90,6 @@ GIT_EXTERN(int) git_remote_lookup(git_remote **out, git_repository *repo, const char *name); /** - * Save a remote to its repository's configuration - * - * One can't save a in-memory remote. Doing so will - * result in a GIT_EINVALIDSPEC being returned. - * - * @param remote the remote to save to config - * @return 0, GIT_EINVALIDSPEC or an error code - */ -GIT_EXTERN(int) git_remote_save(const git_remote *remote); - -/** * Create a copy of an existing remote. All internal strings are also * duplicated. Callbacks are not duplicated. * @@ -139,6 +120,9 @@ /** * Get the remote's url * + * If url.*.insteadOf has been configured for this URL, it will + * return the modified URL. + * * @param remote the remote * @return a pointer to the url */ @@ -147,44 +131,52 @@ /** * Get the remote's url for pushing * + * If url.*.pushInsteadOf has been configured for this URL, it + * will return the modified URL. + * * @param remote the remote * @return a pointer to the url or NULL if no special url for pushing is set */ GIT_EXTERN(const char *) git_remote_pushurl(const git_remote *remote); /** - * Set the remote's url + * Set the remote's url in the configuration * - * Existing connections will not be updated. + * Remote objects already in memory will not be affected. This assumes + * the common case of a single-url remote and will otherwise return an error. * - * @param remote the remote + * @param repo the repository in which to perform the change + * @param remote the remote's name * @param url the url to set * @return 0 or an error value */ -GIT_EXTERN(int) git_remote_set_url(git_remote *remote, const char* url); +GIT_EXTERN(int) git_remote_set_url(git_repository *repo, const char *remote, const char* url); /** - * Set the remote's url for pushing + * Set the remote's url for pushing in the configuration. * - * Existing connections will not be updated. + * Remote objects already in memory will not be affected. This assumes + * the common case of a single-url remote and will otherwise return an error. * - * @param remote the remote - * @param url the url to set or NULL to clear the pushurl - * @return 0 or an error value + * + * @param repo the repository in which to perform the change + * @param remote the remote's name + * @param url the url to set */ -GIT_EXTERN(int) git_remote_set_pushurl(git_remote *remote, const char* url); +GIT_EXTERN(int) git_remote_set_pushurl(git_repository *repo, const char *remote, const char* url); /** - * Add a fetch refspec to the remote + * Add a fetch refspec to the remote's configuration * - * Convenience function for adding a single fetch refspec to the - * current list in the remote. + * Add the given refspec to the fetch list in the configuration. No + * loaded remote instances will be affected. * - * @param remote the remote + * @param repo the repository in which to change the configuration + * @param remote the name of the remote to change * @param refspec the new fetch refspec - * @return 0 or an error value + * @return 0, GIT_EINVALIDSPEC if refspec is invalid or an error value */ -GIT_EXTERN(int) git_remote_add_fetch(git_remote *remote, const char *refspec); +GIT_EXTERN(int) git_remote_add_fetch(git_repository *repo, const char *remote, const char *refspec); /** * Get the remote's list of fetch refspecs @@ -198,26 +190,17 @@ GIT_EXTERN(int) git_remote_get_fetch_refspecs(git_strarray *array, const git_remote *remote); /** - * Set the remote's list of fetch refspecs + * Add a push refspec to the remote's configuration * - * The contents of the string array are copied. + * Add the given refspec to the push list in the configuration. No + * loaded remote instances will be affected. * - * @param remote the remote to modify - * @param array the new list of fetch resfpecs - */ -GIT_EXTERN(int) git_remote_set_fetch_refspecs(git_remote *remote, git_strarray *array); - -/** - * Add a push refspec to the remote - * - * Convenience function for adding a single push refspec to the - * current list in the remote. - * - * @param remote the remote + * @param repo the repository in which to change the configuration + * @param remote the name of the remote to change * @param refspec the new push refspec - * @return 0 or an error value + * @return 0, GIT_EINVALIDSPEC if refspec is invalid or an error value */ -GIT_EXTERN(int) git_remote_add_push(git_remote *remote, const char *refspec); +GIT_EXTERN(int) git_remote_add_push(git_repository *repo, const char *remote, const char *refspec); /** * Get the remote's list of push refspecs @@ -231,25 +214,6 @@ GIT_EXTERN(int) git_remote_get_push_refspecs(git_strarray *array, const git_remote *remote); /** - * Set the remote's list of push refspecs - * - * The contents of the string array are copied. - * - * @param remote the remote to modify - * @param array the new list of push resfpecs - */ -GIT_EXTERN(int) git_remote_set_push_refspecs(git_remote *remote, git_strarray *array); - -/** - * Clear the refspecs - * - * Remove all configured fetch and push refspecs from the remote. - * - * @param remote the remote - */ -GIT_EXTERN(void) git_remote_clear_refspecs(git_remote *remote); - -/** * Get the number of refspecs for a remote * * @param remote the remote @@ -276,9 +240,10 @@ * @param remote the remote to connect to * @param direction GIT_DIRECTION_FETCH if you want to fetch or * GIT_DIRECTION_PUSH if you want to push + * @param callbacks the callbacks to use for this connection * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction); +GIT_EXTERN(int) git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks); /** * Get the remote repository's reference advertisement list @@ -303,36 +268,6 @@ GIT_EXTERN(int) git_remote_ls(const git_remote_head ***out, size_t *size, git_remote *remote); /** - * Download and index the packfile - * - * Connect to the remote if it hasn't been done yet, negotiate with - * the remote git which objects are missing, download and index the - * packfile. - * - * The .idx file will be created and both it and the packfile with be - * renamed to their final name. - * - * @param remote the remote - * @param refspecs the refspecs to use for this negotiation and - * download. Use NULL or an empty array to use the base refspecs - * @return 0 or an error code - */ -GIT_EXTERN(int) git_remote_download(git_remote *remote, const git_strarray *refspecs); - -/** - * Create a packfile and send it to the server - * - * Connect to the remote if it hasn't been done yet, negotiate with - * the remote git which objects are missing, create a packfile with the missing objects and send it. - * - * @param remote the remote - * @param refspecs the refspecs to use for this negotiation and - * upload. Use NULL or an empty array to use the base refspecs - * @return 0 or an error code - */ -GIT_EXTERN(int) git_remote_upload(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts); - -/** * Check whether the remote is connected * * Check whether the remote's underlying transport is connected to the @@ -373,66 +308,6 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote); /** - * Update the tips to the new state - * - * @param remote the remote to update - * @param signature The identity to use when updating reflogs - * @param reflog_message The message to insert into the reflogs. If NULL, the - * default is "fetch ", where is the name of - * the remote (or its url, for in-memory remotes). - * @return 0 or an error code - */ -GIT_EXTERN(int) git_remote_update_tips( - git_remote *remote, - const git_signature *signature, - const char *reflog_message); - -/** - * Prune tracking refs that are no longer present on remote - * - * @param remote the remote to prune - * @return 0 or an error code - */ -GIT_EXTERN(int) git_remote_prune(git_remote *remote); - -/** - * Download new data and update tips - * - * Convenience function to connect to a remote, download the data, - * disconnect and update the remote-tracking branches. - * - * @param remote the remote to fetch from - * @param refspecs the refspecs to use for this fetch. Pass NULL or an - * empty array to use the base refspecs. - * @param signature The identity to use when updating reflogs - * @param reflog_message The message to insert into the reflogs. If NULL, the - * default is "fetch" - * @return 0 or an error code - */ -GIT_EXTERN(int) git_remote_fetch( - git_remote *remote, - const git_strarray *refspecs, - const git_signature *signature, - const char *reflog_message); - -/** - * Perform a push - * - * Peform all the steps from a push. - * - * @param remote the remote to push to - * @param refspecs the refspecs to use for pushing. If none are - * passed, the configured refspecs will be used - * @param opts the options - * @param signature signature to use for the reflog of updated references - * @param reflog_message message to use for the reflog of upated references - */ -GIT_EXTERN(int) git_remote_push(git_remote *remote, - const git_strarray *refspecs, - const git_push_options *opts, - const git_signature *signature, const char *reflog_message); - -/** * Get a list of the configured remotes for a repo * * The string array must be freed by the user. @@ -453,6 +328,42 @@ GIT_REMOTE_COMPLETION_ERROR, } git_remote_completion_type; +/** Push network progress notification function */ +typedef int (*git_push_transfer_progress)( + unsigned int current, + unsigned int total, + size_t bytes, + void* payload); +/** + * Represents an update which will be performed on the remote during push + */ +typedef struct { + /** + * The source name of the reference + */ + char *src_refname; + /** + * The name of the reference to update on the server + */ + char *dst_refname; + /** + * The current target of the reference + */ + git_oid src; + /** + * The new target for the reference + */ + git_oid dst; +} git_push_update; + +/** + * @param updates an array containing the updates which will be sent + * as commands to the destination. + * @param len number of elements in `updates` + * @param payload Payload provided by the caller + */ +typedef int (*git_push_negotiation)(const git_push_update **updates, size_t len, void *payload); + /** * The callback settings structure * @@ -527,6 +438,18 @@ int (*push_update_reference)(const char *refname, const char *status, void *data); /** + * Called once between the negotiation step and the upload. It + * provides information about what updates will be performed. + */ + git_push_negotiation push_negotiation; + + /** + * Create the transport to use for this operation. Leave NULL + * to auto-detect. + */ + git_transport_cb transport; + + /** * This will be passed to each of the callbacks in this struct * as the last parameter. */ @@ -548,44 +471,238 @@ git_remote_callbacks *opts, unsigned int version); +typedef enum { + /** + * Use the setting from the configuration + */ + GIT_FETCH_PRUNE_UNSPECIFIED, + /** + * Force pruning on + */ + GIT_FETCH_PRUNE, + /** + * Force pruning off + */ + GIT_FETCH_NO_PRUNE, +} git_fetch_prune_t; + +/** + * Automatic tag following option + * + * Lets us select the --tags option to use. + */ +typedef enum { + /** + * Use the setting from the configuration. + */ + GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED = 0, + /** + * Ask the server for tags pointing to objects we're already + * downloading. + */ + GIT_REMOTE_DOWNLOAD_TAGS_AUTO, + /** + * Don't ask for any tags beyond the refspecs. + */ + GIT_REMOTE_DOWNLOAD_TAGS_NONE, + /** + * Ask for the all the tags. + */ + GIT_REMOTE_DOWNLOAD_TAGS_ALL, +} git_remote_autotag_option_t; + +/** + * Fetch options structure. + * + * Zero out for defaults. Initialize with `GIT_FETCH_OPTIONS_INIT` macro to + * correctly set the `version` field. E.g. + * + * git_fetch_options opts = GIT_FETCH_OPTIONS_INIT; + */ +typedef struct { + int version; + + /** + * Callbacks to use for this fetch operation + */ + git_remote_callbacks callbacks; + + /** + * Whether to perform a prune after the fetch + */ + git_fetch_prune_t prune; + + /** + * Whether to write the results to FETCH_HEAD. Defaults to + * on. Leave this default in order to behave like git. + */ + int update_fetchhead; + + /** + * Determines how to behave regarding tags on the remote, such + * as auto-downloading tags for objects we're downloading or + * downloading all of them. + * + * The default is to auto-follow tags. + */ + git_remote_autotag_option_t download_tags; +} git_fetch_options; + +#define GIT_FETCH_OPTIONS_VERSION 1 +#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_UNSPECIFIED, 1 } + +/** + * Initializes a `git_fetch_options` with default values. Equivalent to + * creating an instance with GIT_FETCH_OPTIONS_INIT. + * + * @param opts the `git_push_options` instance to initialize. + * @param version the version of the struct; you should pass + * `GIT_FETCH_OPTIONS_VERSION` here. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_fetch_init_options( + git_fetch_options *opts, + unsigned int version); + + +/** + * Controls the behavior of a git_push object. + */ +typedef struct { + unsigned int version; + + /** + * If the transport being used to push to the remote requires the creation + * of a pack file, this controls the number of worker threads used by + * the packbuilder when creating that pack file to be sent to the remote. + * + * If set to 0, the packbuilder will auto-detect the number of threads + * to create. The default value is 1. + */ + unsigned int pb_parallelism; + + /** + * Callbacks to use for this push operation + */ + git_remote_callbacks callbacks; +} git_push_options; + +#define GIT_PUSH_OPTIONS_VERSION 1 +#define GIT_PUSH_OPTIONS_INIT { GIT_PUSH_OPTIONS_VERSION, 0, GIT_REMOTE_CALLBACKS_INIT } + +/** + * Initializes a `git_push_options` with default values. Equivalent to + * creating an instance with GIT_PUSH_OPTIONS_INIT. + * + * @param opts the `git_push_options` instance to initialize. + * @param version the version of the struct; you should pass + * `GIT_PUSH_OPTIONS_VERSION` here. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_push_init_options( + git_push_options *opts, + unsigned int version); + +/** + * Download and index the packfile + * + * Connect to the remote if it hasn't been done yet, negotiate with + * the remote git which objects are missing, download and index the + * packfile. + * + * The .idx file will be created and both it and the packfile with be + * renamed to their final name. + * + * @param remote the remote + * @param refspecs the refspecs to use for this negotiation and + * download. Use NULL or an empty array to use the base refspecs + * @param opts the options to use for this fetch + * @return 0 or an error code + */ + GIT_EXTERN(int) git_remote_download(git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts); + /** - * Set the callbacks for a remote + * Create a packfile and send it to the server + * + * Connect to the remote if it hasn't been done yet, negotiate with + * the remote git which objects are missing, create a packfile with the missing objects and send it. * - * Note that the remote keeps its own copy of the data and you need to - * call this function again if you want to change the callbacks. + * @param remote the remote + * @param refspecs the refspecs to use for this negotiation and + * upload. Use NULL or an empty array to use the base refspecs + * @param opts the options to use for this push + * @return 0 or an error code + */ +GIT_EXTERN(int) git_remote_upload(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts); + +/** + * Update the tips to the new state * - * @param remote the remote to configure - * @param callbacks a pointer to the user's callback settings + * @param remote the remote to update + * @param reflog_message The message to insert into the reflogs. If + * NULL and fetching, the default is "fetch ", where is + * the name of the remote (or its url, for in-memory remotes). This + * parameter is ignored when pushing. + * @param callbacks pointer to the callback structure to use + * @param update_fetchhead whether to write to FETCH_HEAD. Pass 1 to behave like git. + * @param download_tags what the behaviour for downloading tags is for this fetch. This is + * ignored for push. This must be the same value passed to `git_remote_download()`. * @return 0 or an error code */ -GIT_EXTERN(int) git_remote_set_callbacks(git_remote *remote, const git_remote_callbacks *callbacks); +GIT_EXTERN(int) git_remote_update_tips( + git_remote *remote, + const git_remote_callbacks *callbacks, + int update_fetchhead, + git_remote_autotag_option_t download_tags, + const char *reflog_message); /** - * Retrieve the current callback structure + * Download new data and update tips * - * This provides read access to the callbacks structure as the remote - * sees it. + * Convenience function to connect to a remote, download the data, + * disconnect and update the remote-tracking branches. * - * @param remote the remote to query - * @return a pointer to the callbacks structure + * @param remote the remote to fetch from + * @param refspecs the refspecs to use for this fetch. Pass NULL or an + * empty array to use the base refspecs. + * @param opts options to use for this fetch + * @param reflog_message The message to insert into the reflogs. If NULL, the + * default is "fetch" + * @return 0 or an error code */ -GIT_EXTERN(const git_remote_callbacks *) git_remote_get_callbacks(git_remote *remote); +GIT_EXTERN(int) git_remote_fetch( + git_remote *remote, + const git_strarray *refspecs, + const git_fetch_options *opts, + const char *reflog_message); /** - * Get the statistics structure that is filled in by the fetch operation. + * Prune tracking refs that are no longer present on remote + * + * @param remote the remote to prune + * @param callbacks callbacks to use for this prune + * @return 0 or an error code */ -GIT_EXTERN(const git_transfer_progress *) git_remote_stats(git_remote *remote); +GIT_EXTERN(int) git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks); /** - * Automatic tag following option + * Perform a push * - * Lets us select the --tags option to use. + * Peform all the steps from a push. + * + * @param remote the remote to push to + * @param refspecs the refspecs to use for pushing. If none are + * passed, the configured refspecs will be used + * @param opts options to use for this push */ -typedef enum { - GIT_REMOTE_DOWNLOAD_TAGS_AUTO = 0, - GIT_REMOTE_DOWNLOAD_TAGS_NONE = 1, - GIT_REMOTE_DOWNLOAD_TAGS_ALL = 2 -} git_remote_autotag_option_t; +GIT_EXTERN(int) git_remote_push(git_remote *remote, + const git_strarray *refspecs, + const git_push_options *opts); + +/** + * Get the statistics structure that is filled in by the fetch operation. + */ +GIT_EXTERN(const git_transfer_progress *) git_remote_stats(git_remote *remote); /** * Retrieve the tag auto-follow setting @@ -596,15 +713,16 @@ GIT_EXTERN(git_remote_autotag_option_t) git_remote_autotag(const git_remote *remote); /** - * Set the tag auto-follow setting + * Set the remote's tag following setting. + * + * The change will be made in the configuration. No loaded remotes + * will be affected. * - * @param remote the remote to configure - * @param value a GIT_REMOTE_DOWNLOAD_TAGS value + * @param repo the repository in which to make the change + * @param remote the name of the remote + * @param value the new value to take. */ -GIT_EXTERN(void) git_remote_set_autotag( - git_remote *remote, - git_remote_autotag_option_t value); - +GIT_EXTERN(int) git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_autotag_option_t value); /** * Retrieve the ref-prune setting * @@ -629,7 +747,7 @@ * stored here for further processing by the caller. Always free this * strarray on successful return. * @param repo the repository in which to rename - * @param name the current name of the reamote + * @param name the current name of the remote * @param new_name the new name the remote should bear * @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code */ @@ -640,23 +758,6 @@ const char *new_name); /** - * Retrieve the update FETCH_HEAD setting. - * - * @param remote the remote to query - * @return the update FETCH_HEAD setting - */ -GIT_EXTERN(int) git_remote_update_fetchhead(git_remote *remote); - -/** - * Sets the update FETCH_HEAD setting. By default, FETCH_HEAD will be - * updated on every fetch. Set to 0 to disable. - * - * @param remote the remote to configure - * @param value 0 to disable updating FETCH_HEAD - */ -GIT_EXTERN(void) git_remote_set_update_fetchhead(git_remote *remote, int value); - -/** * Ensure the remote name is well-formed. * * @param remote_name name to be checked. diff -Nru libgit2-0.22.2/include/git2/repository.h libgit2-0.23.1/include/git2/repository.h --- libgit2-0.22.2/include/git2/repository.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/repository.h 2015-08-03 18:07:35.000000000 +0000 @@ -603,15 +603,11 @@ * * @param repo Repository pointer * @param refname Canonical name of the reference the HEAD should point at - * @param signature The identity that will used to populate the reflog entry - * @param log_message The one line long message to be appended to the reflog * @return 0 on success, or an error code */ GIT_EXTERN(int) git_repository_set_head( git_repository* repo, - const char* refname, - const git_signature *signature, - const char *log_message); + const char* refname); /** * Make the repository HEAD directly point to the Commit. @@ -627,15 +623,27 @@ * * @param repo Repository pointer * @param commitish Object id of the Commit the HEAD should point to - * @param signature The identity that will used to populate the reflog entry - * @param log_message The one line long message to be appended to the reflog * @return 0 on success, or an error code */ GIT_EXTERN(int) git_repository_set_head_detached( git_repository* repo, - const git_oid* commitish, - const git_signature *signature, - const char *log_message); + const git_oid* commitish); + +/** + * Make the repository HEAD directly point to the Commit. + * + * This behaves like `git_repository_set_head_detached()` but takes an + * annotated commit, which lets you specify which extended sha syntax + * string was specified by a user, allowing for more exact reflog + * messages. + * + * See the documentation for `git_repository_set_head_detached()`. + * + * @see git_repository_set_head_detached + */ +GIT_EXTERN(int) git_repository_set_head_detached_from_annotated( + git_repository *repo, + const git_annotated_commit *commitish); /** * Detach the HEAD. @@ -651,15 +659,11 @@ * Otherwise, the HEAD will be detached and point to the peeled Commit. * * @param repo Repository pointer - * @param signature The identity that will used to populate the reflog entry - * @param reflog_message The one line long message to be appended to the reflog * @return 0 on success, GIT_EUNBORNBRANCH when HEAD points to a non existing * branch or an error code */ GIT_EXTERN(int) git_repository_detach_head( - git_repository* repo, - const git_signature *signature, - const char *reflog_message); + git_repository* repo); /** * Repository state @@ -720,6 +724,31 @@ */ GIT_EXTERN(int) git_repository_is_shallow(git_repository *repo); +/** + * Retrieve the configured identity to use for reflogs + * + * The memory is owned by the repository and must not be freed by the + * user. + * + * @param name where to store the pointer to the name + * @param email where to store the pointer to the email + * @param repo the repository + */ +GIT_EXTERN(int) git_repository_ident(const char **name, const char **email, const git_repository *repo); + +/** + * Set the identity to be used for writing reflogs + * + * If both are set, this name and email will be used to write to the + * reflog. Pass NULL to unset. When unset, the identity will be taken + * from the repository's configuration. + * + * @param repo the repository to configure + * @param name the name to use for the reflog entries + * @param email the email to use for the reflog entries + */ +GIT_EXTERN(int) git_repository_set_ident(git_repository *repo, const char *name, const char *email); + /** @} */ GIT_END_DECL #endif diff -Nru libgit2-0.22.2/include/git2/reset.h libgit2-0.23.1/include/git2/reset.h --- libgit2-0.22.2/include/git2/reset.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/reset.h 2015-08-03 18:07:35.000000000 +0000 @@ -10,6 +10,7 @@ #include "common.h" #include "types.h" #include "strarray.h" +#include "checkout.h" /** * @file git2/reset.h @@ -56,22 +57,31 @@ * The checkout_strategy field will be overridden (based on reset_type). * This parameter can be used to propagate notify and progress callbacks. * - * @param signature The identity that will used to populate the reflog entry - * - * @param log_message The one line long message to be appended to the reflog. - * The reflog is only updated if the affected direct reference is actually - * changing. If NULL, the default is "reset: moving"; if you want something more - * useful, provide a message. - * * @return 0 on success or an error code */ GIT_EXTERN(int) git_reset( git_repository *repo, git_object *target, git_reset_t reset_type, - git_checkout_options *checkout_opts, - const git_signature *signature, - const char *log_message); + const git_checkout_options *checkout_opts); + +/** + * Sets the current head to the specified commit oid and optionally + * resets the index and working tree to match. + * + * This behaves like `git_reset()` but takes an annotated commit, + * which lets you specify which extended sha syntax string was + * specified by a user, allowing for more exact reflog messages. + * + * See the documentation for `git_reset()`. + * + * @see git_reset + */ +GIT_EXTERN(int) git_reset_from_annotated( + git_repository *repo, + git_annotated_commit *commit, + git_reset_t reset_type, + const git_checkout_options *checkout_opts); /** * Updates some entries in the index from the target commit tree. diff -Nru libgit2-0.22.2/include/git2/revert.h libgit2-0.23.1/include/git2/revert.h --- libgit2-0.22.2/include/git2/revert.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/revert.h 2015-08-03 18:07:35.000000000 +0000 @@ -29,8 +29,8 @@ /** For merge commits, the "mainline" is treated as the parent. */ unsigned int mainline; - git_merge_options merge_opts; /*< Options for the merging */ - git_checkout_options checkout_opts; /*< Options for the checkout */ + git_merge_options merge_opts; /**< Options for the merging */ + git_checkout_options checkout_opts; /**< Options for the checkout */ } git_revert_options; #define GIT_REVERT_OPTIONS_VERSION 1 diff -Nru libgit2-0.22.2/include/git2/revwalk.h libgit2-0.23.1/include/git2/revwalk.h --- libgit2-0.22.2/include/git2/revwalk.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/revwalk.h 2015-08-03 18:07:35.000000000 +0000 @@ -90,15 +90,17 @@ GIT_EXTERN(void) git_revwalk_reset(git_revwalk *walker); /** - * Mark a commit to start traversal from. + * Add a new root for the traversal * - * The given OID must belong to a committish on the walked - * repository. + * The pushed commit will be marked as one of the roots from which to + * start the walk. This commit may not be walked if it or a child is + * hidden. + * + * At least one commit must be pushed onto the walker before a walk + * can be started. * - * The given commit will be used as one of the roots - * when starting the revision walk. At least one commit - * must be pushed onto the walker before a walk can - * be started. + * The given id must belong to a committish on the walked + * repository. * * @param walk the walker being used for the traversal. * @param id the oid of the commit to start from. @@ -135,7 +137,7 @@ /** * Mark a commit (and its ancestors) uninteresting for the output. * - * The given OID must belong to a committish on the walked + * The given id must belong to a committish on the walked * repository. * * The resolved commit and all its parents will be hidden from the diff -Nru libgit2-0.22.2/include/git2/stash.h libgit2-0.23.1/include/git2/stash.h --- libgit2-0.22.2/include/git2/stash.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/stash.h 2015-08-03 18:07:35.000000000 +0000 @@ -70,6 +70,120 @@ const char *message, unsigned int flags); +/** Stash application flags. */ +typedef enum { + GIT_STASH_APPLY_DEFAULT = 0, + + /* Try to reinstate not only the working tree's changes, + * but also the index's changes. + */ + GIT_STASH_APPLY_REINSTATE_INDEX = (1 << 0), +} git_stash_apply_flags; + +typedef enum { + GIT_STASH_APPLY_PROGRESS_NONE = 0, + + /** Loading the stashed data from the object database. */ + GIT_STASH_APPLY_PROGRESS_LOADING_STASH, + + /** The stored index is being analyzed. */ + GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX, + + /** The modified files are being analyzed. */ + GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED, + + /** The untracked and ignored files are being analyzed. */ + GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED, + + /** The untracked files are being written to disk. */ + GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED, + + /** The modified files are being written to disk. */ + GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED, + + /** The stash was applied successfully. */ + GIT_STASH_APPLY_PROGRESS_DONE, +} git_stash_apply_progress_t; + +/** + * Stash application progress notification function. + * Return 0 to continue processing, or a negative value to + * abort the stash application. + */ +typedef int (*git_stash_apply_progress_cb)( + git_stash_apply_progress_t progress, + void *payload); + +/** Stash application options structure. + * + * Initialize with the `GIT_STASH_APPLY_OPTIONS_INIT` macro to set + * sensible defaults; for example: + * + * git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + */ +typedef struct git_stash_apply_options { + unsigned int version; + + /** See `git_stash_apply_flags_t`, above. */ + git_stash_apply_flags flags; + + /** Options to use when writing files to the working directory. */ + git_checkout_options checkout_options; + + /** Optional callback to notify the consumer of application progress. */ + git_stash_apply_progress_cb progress_cb; + void *progress_payload; +} git_stash_apply_options; + +#define GIT_STASH_APPLY_OPTIONS_VERSION 1 +#define GIT_STASH_APPLY_OPTIONS_INIT { \ + GIT_STASH_APPLY_OPTIONS_VERSION, \ + GIT_STASH_APPLY_DEFAULT, \ + GIT_CHECKOUT_OPTIONS_INIT } + +/** + * Initializes a `git_stash_apply_options` with default values. Equivalent to + * creating an instance with GIT_STASH_APPLY_OPTIONS_INIT. + * + * @param opts the `git_stash_apply_options` instance to initialize. + * @param version the version of the struct; you should pass + * `GIT_STASH_APPLY_OPTIONS_INIT` here. + * @return Zero on success; -1 on failure. + */ +int git_stash_apply_init_options( + git_stash_apply_options *opts, unsigned int version); + +/** + * Apply a single stashed state from the stash list. + * + * If local changes in the working directory conflict with changes in the + * stash then GIT_EMERGECONFLICT will be returned. In this case, the index + * will always remain unmodified and all files in the working directory will + * remain unmodified. However, if you are restoring untracked files or + * ignored files and there is a conflict when applying the modified files, + * then those files will remain in the working directory. + * + * If passing the GIT_STASH_APPLY_REINSTATE_INDEX flag and there would be + * conflicts when reinstating the index, the function will return + * GIT_EMERGECONFLICT and both the working directory and index will be left + * unmodified. + * + * Note that a minimum checkout strategy of `GIT_CHECKOUT_SAFE` is implied. + * + * @param repo The owning repository. + * @param index The position within the stash list. 0 points to the + * most recent stashed state. + * @param options Options to control how stashes are applied. + * + * @return 0 on success, GIT_ENOTFOUND if there's no stashed state for the + * given index, GIT_EMERGECONFLICT if changes exist in the working + * directory, or an error code + */ +GIT_EXTERN(int) git_stash_apply( + git_repository *repo, + size_t index, + const git_stash_apply_options *options); + /** * This is a callback function you can provide to iterate over all the * stashed states that will be invoked per entry. @@ -79,7 +193,7 @@ * @param message The stash message. * @param stash_id The commit oid of the stashed state. * @param payload Extra parameter to callback function. - * @return 0 to continue iterating or non-zero to stop + * @return 0 to continue iterating or non-zero to stop. */ typedef int (*git_stash_cb)( size_t index, @@ -99,7 +213,7 @@ * * @param payload Extra parameter to callback function. * - * @return 0 on success, non-zero callback return value, or error code + * @return 0 on success, non-zero callback return value, or error code. */ GIT_EXTERN(int) git_stash_foreach( git_repository *repo, @@ -114,13 +228,30 @@ * @param index The position within the stash list. 0 points to the * most recent stashed state. * - * @return 0 on success, or error code + * @return 0 on success, GIT_ENOTFOUND if there's no stashed state for the given + * index, or error code. */ - GIT_EXTERN(int) git_stash_drop( git_repository *repo, size_t index); +/** + * Apply a single stashed state from the stash list and remove it from the list + * if successful. + * + * @param repo The owning repository. + * @param index The position within the stash list. 0 points to the + * most recent stashed state. + * @param options Options to control how stashes are applied. + * + * @return 0 on success, GIT_ENOTFOUND if there's no stashed state for the given + * index, or error code. (see git_stash_apply() above for details) +*/ +GIT_EXTERN(int) git_stash_pop( + git_repository *repo, + size_t index, + const git_stash_apply_options *options); + /** @} */ GIT_END_DECL #endif diff -Nru libgit2-0.22.2/include/git2/status.h libgit2-0.23.1/include/git2/status.h --- libgit2-0.22.2/include/git2/status.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/status.h 2015-08-03 18:07:35.000000000 +0000 @@ -46,6 +46,7 @@ GIT_STATUS_WT_UNREADABLE = (1u << 12), GIT_STATUS_IGNORED = (1u << 14), + GIT_STATUS_CONFLICTED = (1u << 15), } git_status_t; /** diff -Nru libgit2-0.22.2/include/git2/submodule.h libgit2-0.23.1/include/git2/submodule.h --- libgit2-0.22.2/include/git2/submodule.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/submodule.h 2015-08-03 18:07:35.000000000 +0000 @@ -130,30 +130,26 @@ git_checkout_options checkout_opts; /** - * Callbacks to use for reporting fetch progress, and for acquiring + * Options which control the fetch, including callbacks. + * + * The callbacks to use for reporting fetch progress, and for acquiring * credentials in the event they are needed. */ - git_remote_callbacks remote_callbacks; + git_fetch_options fetch_opts; /** * The checkout strategy to use when the sub repository needs to - * be cloned. Use GIT_CHECKOUT_SAFE_CREATE to create all files + * be cloned. Use GIT_CHECKOUT_SAFE to create all files * in the working directory for the newly cloned repository. */ unsigned int clone_checkout_strategy; - - /** - * The identity used when updating the reflog. NULL means to - * use the default signature using the config. - */ - git_signature *signature; } git_submodule_update_options; #define GIT_SUBMODULE_UPDATE_OPTIONS_VERSION 1 #define GIT_SUBMODULE_UPDATE_OPTIONS_INIT \ { GIT_CHECKOUT_OPTIONS_VERSION, \ - { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE}, \ - GIT_REMOTE_CALLBACKS_INIT, GIT_CHECKOUT_SAFE_CREATE } + { GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE }, \ + GIT_FETCH_OPTIONS_INIT, GIT_CHECKOUT_SAFE } /** * Initializes a `git_submodule_update_options` with default values. @@ -305,20 +301,6 @@ int write_index); /** - * Write submodule settings to .gitmodules file. - * - * This commits any in-memory changes to the submodule to the gitmodules - * file on disk. You may also be interested in `git_submodule_init()` which - * writes submodule info to ".git/config" (which is better for local changes - * to submodule settings) and/or `git_submodule_sync()` which writes - * settings about remotes to the actual submodule repository. - * - * @param submodule The submodule to write. - * @return 0 on success, <0 on failure. - */ -GIT_EXTERN(int) git_submodule_save(git_submodule *submodule); - -/** * Get the containing repository for a submodule. * * This returns a pointer to the repository that contains the submodule. @@ -377,20 +359,31 @@ GIT_EXTERN(const char *) git_submodule_branch(git_submodule *submodule); /** - * Set the URL for the submodule. + * Set the branch for the submodule in the configuration * - * This sets the URL in memory for the submodule. This will be used for - * any following submodule actions while this submodule data is in memory. + * After calling this, you may wish to call `git_submodule_sync()` to + * write the changes to the checked out submodule repository. * - * After calling this, you may wish to call `git_submodule_save()` to write - * the changes back to the ".gitmodules" file and `git_submodule_sync()` to + * @param repo the repository to affect + * @param name the name of the submodule to configure + * @param branch Branch that should be used for the submodule + * @return 0 on success, <0 on failure + */ +GIT_EXTERN(int) git_submodule_set_branch(git_repository *repo, const char *name, const char *branch); + +/** + * Set the URL for the submodule in the configuration + * + * + * After calling this, you may wish to call `git_submodule_sync()` to * write the changes to the checked out submodule repository. * - * @param submodule Pointer to the submodule object + * @param repo the repository to affect + * @param name the name of the submodule to configure * @param url URL that should be used for the submodule * @return 0 on success, <0 on failure */ -GIT_EXTERN(int) git_submodule_set_url(git_submodule *submodule, const char *url); +GIT_EXTERN(int) git_submodule_set_url(git_repository *repo, const char *name, const char *url); /** * Get the OID for the submodule in the index. @@ -440,9 +433,6 @@ * The working directory will be consider clean so long as there is a * checked out version present. * - * plus the special **GIT_SUBMODULE_IGNORE_RESET** which can be used with - * `git_submodule_set_ignore()` to revert to the on-disk setting. - * * @param submodule The submodule to check * @return The current git_submodule_ignore_t valyue what will be used for * this submodule. @@ -451,32 +441,25 @@ git_submodule *submodule); /** - * Set the ignore rule for the submodule. - * - * This sets the in-memory ignore rule for the submodule which will - * control the behavior of `git_submodule_status()`. - * - * To make changes persistent, call `git_submodule_save()` to write the - * value to disk (in the ".gitmodules" and ".git/config" files). + * Set the ignore rule for the submodule in the configuration * - * Call with `GIT_SUBMODULE_IGNORE_RESET` or call `git_submodule_reload()` - * to revert the in-memory rule to the value that is on disk. + * This does not affect any currently-loaded instances. * - * @param submodule The submodule to update + * @param repo the repository to affect + * @param name the name of the submdule * @param ignore The new value for the ignore rule - * @return old value for ignore + * @return 0 or an error code */ -GIT_EXTERN(git_submodule_ignore_t) git_submodule_set_ignore( - git_submodule *submodule, +GIT_EXTERN(int) git_submodule_set_ignore( + git_repository *repo, + const char *name, git_submodule_ignore_t ignore); /** * Get the update rule that will be used for the submodule. * * This value controls the behavior of the `git submodule update` command. - * There are four useful values documented with `git_submodule_update_t` - * plus the `GIT_SUBMODULE_UPDATE_RESET` which can be used to revert to - * the on-disk setting. + * There are four useful values documented with `git_submodule_update_t`. * * @param submodule The submodule to check * @return The current git_submodule_update_t value that will be used @@ -486,23 +469,18 @@ git_submodule *submodule); /** - * Set the update rule for the submodule. + * Set the update rule for the submodule in the configuration * - * The initial value comes from the ".git/config" setting of - * `submodule.$name.update` for this submodule (which is initialized from - * the ".gitmodules" file). Using this function sets the update rule in - * memory for the submodule. Call `git_submodule_save()` to write out the - * new update rule. + * This setting won't affect any existing instances. * - * Calling this again with GIT_SUBMODULE_UPDATE_RESET or calling - * `git_submodule_reload()` will revert the rule to the on disk value. - * - * @param submodule The submodule to update + * @param repo the repository to affect + * @param name the name of the submodule to configure * @param update The new value to use - * @return old value for update + * @return 0 or an error code */ -GIT_EXTERN(git_submodule_update_t) git_submodule_set_update( - git_submodule *submodule, +GIT_EXTERN(int) git_submodule_set_update( + git_repository *repo, + const char *name, git_submodule_update_t update); /** @@ -520,18 +498,18 @@ git_submodule *submodule); /** - * Set the fetchRecurseSubmodules rule for a submodule. + * Set the fetchRecurseSubmodules rule for a submodule in the configuration * - * This sets the submodule..fetchRecurseSubmodules value for - * the submodule. You should call `git_submodule_save()` if you want - * to persist the new value. + * This setting won't affect any existing instances. * - * @param submodule The submodule to modify + * @param repo the repository to affect + * @param name the submodule to configure * @param fetch_recurse_submodules Boolean value * @return old value for fetchRecurseSubmodules */ -GIT_EXTERN(git_submodule_recurse_t) git_submodule_set_fetch_recurse_submodules( - git_submodule *submodule, +GIT_EXTERN(int) git_submodule_set_fetch_recurse_submodules( + git_repository *repo, + const char *name, git_submodule_recurse_t fetch_recurse_submodules); /** @@ -606,32 +584,24 @@ GIT_EXTERN(int) git_submodule_reload(git_submodule *submodule, int force); /** - * Reread all submodule info. - * - * Call this to reload all cached submodule information for the repo. - * - * @param repo The repository to reload submodule data for - * @param force Force full reload even if the data doesn't seem out of date - * @return 0 on success, <0 on error - */ -GIT_EXTERN(int) git_submodule_reload_all(git_repository *repo, int force); - -/** * Get the status for a submodule. * * This looks at a submodule and tries to determine the status. It * will return a combination of the `GIT_SUBMODULE_STATUS` values above. * How deeply it examines the working directory to do this will depend - * on the `git_submodule_ignore_t` value for the submodule - which can be - * set either temporarily or permanently with `git_submodule_set_ignore()`. + * on the `git_submodule_ignore_t` value for the submodule. * * @param status Combination of `GIT_SUBMODULE_STATUS` flags - * @param submodule Submodule for which to get status + * @param repo the repository in which to look + * @param name name of the submodule + * @param ignore the ignore rules to follow * @return 0 on success, <0 on error */ GIT_EXTERN(int) git_submodule_status( unsigned int *status, - git_submodule *submodule); + git_repository *repo, + const char *name, + git_submodule_ignore_t ignore); /** * Get the locations of submodule information. diff -Nru libgit2-0.22.2/include/git2/sys/config.h libgit2-0.23.1/include/git2/sys/config.h --- libgit2-0.22.2/include/git2/sys/config.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/config.h 2015-08-03 18:07:35.000000000 +0000 @@ -53,11 +53,13 @@ */ struct git_config_backend { unsigned int version; + /** True if this backend is for a snapshot */ + int readonly; struct git_config *cfg; /* Open means open the file/database and parse if necessary */ int (*open)(struct git_config_backend *, git_config_level_t level); - int (*get)(struct git_config_backend *, const char *key, const git_config_entry **entry); + int (*get)(struct git_config_backend *, const char *key, git_config_entry **entry); int (*set)(struct git_config_backend *, const char *key, const char *value); int (*set_multivar)(git_config_backend *cfg, const char *name, const char *regexp, const char *value); int (*del)(struct git_config_backend *, const char *key); @@ -74,7 +76,7 @@ * Initializes a `git_config_backend` with default values. Equivalent to * creating an instance with GIT_CONFIG_BACKEND_INIT. * - * @param opts the `git_config_backend` struct to initialize. + * @param backend the `git_config_backend` struct to initialize. * @param version Version of struct; pass `GIT_CONFIG_BACKEND_VERSION` * @return Zero on success; -1 on failure. */ diff -Nru libgit2-0.22.2/include/git2/sys/diff.h libgit2-0.23.1/include/git2/sys/diff.h --- libgit2-0.22.2/include/git2/sys/diff.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/diff.h 2015-08-03 18:07:35.000000000 +0000 @@ -38,7 +38,7 @@ const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, - void *payload); /*< payload must be a `git_buf *` */ + void *payload); /**< payload must be a `git_buf *` */ /** * Diff print callback that writes to stdio FILE handle. @@ -58,7 +58,7 @@ const git_diff_delta *delta, const git_diff_hunk *hunk, const git_diff_line *line, - void *payload); /*< payload must be a `FILE *` */ + void *payload); /**< payload must be a `FILE *` */ /** @@ -66,8 +66,8 @@ */ typedef struct { unsigned int version; - size_t stat_calls; /*< Number of stat() calls performed */ - size_t oid_calculations; /*< Number of ID calculations */ + size_t stat_calls; /**< Number of stat() calls performed */ + size_t oid_calculations; /**< Number of ID calculations */ } git_diff_perfdata; #define GIT_DIFF_PERFDATA_VERSION 1 diff -Nru libgit2-0.22.2/include/git2/sys/filter.h libgit2-0.23.1/include/git2/sys/filter.h --- libgit2-0.22.2/include/git2/sys/filter.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/filter.h 2015-08-03 18:07:35.000000000 +0000 @@ -123,9 +123,9 @@ GIT_EXTERN(git_filter_mode_t) git_filter_source_mode(const git_filter_source *src); /** - * Get the combination git_filter_opt_t options to be applied + * Get the combination git_filter_flag_t options to be applied */ -GIT_EXTERN(uint32_t) git_filter_source_options(const git_filter_source *src); +GIT_EXTERN(uint32_t) git_filter_source_flags(const git_filter_source *src); /* * struct git_filter @@ -208,6 +208,13 @@ const git_buf *from, const git_filter_source *src); +typedef int (*git_filter_stream_fn)( + git_writestream **out, + git_filter *self, + void **payload, + const git_filter_source *src, + git_writestream *next); + /** * Callback to clean up after filtering has been applied * @@ -247,6 +254,7 @@ git_filter_shutdown_fn shutdown; git_filter_check_fn check; git_filter_apply_fn apply; + git_filter_stream_fn stream; git_filter_cleanup_fn cleanup; }; diff -Nru libgit2-0.22.2/include/git2/sys/hashsig.h libgit2-0.23.1/include/git2/sys/hashsig.h --- libgit2-0.22.2/include/git2/sys/hashsig.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/hashsig.h 2015-08-03 18:07:35.000000000 +0000 @@ -12,33 +12,52 @@ GIT_BEGIN_DECL /** - * Similarity signature of line hashes for a buffer + * Similarity signature of arbitrary text content based on line hashes */ typedef struct git_hashsig git_hashsig; /** - * Options for hashsig calculation + * Options for hashsig computation + * + * The options GIT_HASHSIG_NORMAL, GIT_HASHSIG_IGNORE_WHITESPACE, + * GIT_HASHSIG_SMART_WHITESPACE are exclusive and should not be combined. */ typedef enum { - GIT_HASHSIG_NORMAL = 0, /* use all data */ - GIT_HASHSIG_IGNORE_WHITESPACE = 1, /* ignore whitespace */ - GIT_HASHSIG_SMART_WHITESPACE = 2, /* ignore \r and all space after \n */ + /** + * Use all data + */ + GIT_HASHSIG_NORMAL = 0, + + /** + * Ignore whitespace + */ + GIT_HASHSIG_IGNORE_WHITESPACE = (1 << 0), + + /** + * Ignore \r and all space after \n + */ + GIT_HASHSIG_SMART_WHITESPACE = (1 << 1), + + /** + * Allow hashing of small files + */ + GIT_HASHSIG_ALLOW_SMALL_FILES = (1 << 2) } git_hashsig_option_t; /** - * Build a similarity signature for a buffer + * Compute a similarity signature for a text buffer * - * If you have passed a whitespace-ignoring buffer, then the whitespace - * will be removed from the buffer while it is being processed, modifying - * the buffer in place. Sorry about that! - * - * This will return an error if the buffer doesn't contain enough data to - * compute a valid signature. - * - * @param out The array of hashed runs representing the file content - * @param buf The contents of the file to hash - * @param buflen The length of the data at `buf` - * @param generate_pairwise_hashes Should pairwise runs be hashed + * If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the + * whitespace will be removed from the buffer while it is being processed, + * modifying the buffer in place. Sorry about that! + * + * @param out The computed similarity signature. + * @param buf The input buffer. + * @param buflen The input buffer size. + * @param opts The signature computation options (see above). + * @return 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to + * compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or + * error code. */ GIT_EXTERN(int) git_hashsig_create( git_hashsig **out, @@ -47,13 +66,17 @@ git_hashsig_option_t opts); /** - * Build a similarity signature from a file + * Compute a similarity signature for a text file * * This walks through the file, only loading a maximum of 4K of file data at - * a time. Otherwise, it acts just like `git_hashsig_create`. + * a time. Otherwise, it acts just like `git_hashsig_create`. * - * This will return an error if the file doesn't contain enough data to - * compute a valid signature. + * @param out The computed similarity signature. + * @param path The path to the input file. + * @param opts The signature computation options (see above). + * @return 0 on success, GIT_EBUFS if the buffer doesn't contain enough data to + * compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or + * error code. */ GIT_EXTERN(int) git_hashsig_create_fromfile( git_hashsig **out, @@ -62,13 +85,17 @@ /** * Release memory for a content similarity signature + * + * @param sig The similarity signature to free. */ GIT_EXTERN(void) git_hashsig_free(git_hashsig *sig); /** - * Measure similarity between two files + * Measure similarity score between two similarity signatures * - * @return <0 for error, [0 to 100] as similarity score + * @param a The first similarity signature to compare. + * @param b The second similarity signature to compare. + * @return [0 to 100] on success as the similarity score, or error code. */ GIT_EXTERN(int) git_hashsig_compare( const git_hashsig *a, diff -Nru libgit2-0.22.2/include/git2/sys/odb_backend.h libgit2-0.23.1/include/git2/sys/odb_backend.h --- libgit2-0.22.2/include/git2/sys/odb_backend.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/odb_backend.h 2015-08-03 18:07:35.000000000 +0000 @@ -53,7 +53,7 @@ git_odb_backend *, const git_oid *, const void *, size_t, git_otype); int (* writestream)( - git_odb_stream **, git_odb_backend *, size_t, git_otype); + git_odb_stream **, git_odb_backend *, git_off_t, git_otype); int (* readstream)( git_odb_stream **, git_odb_backend *, const git_oid *); @@ -93,7 +93,7 @@ * Initializes a `git_odb_backend` with default values. Equivalent to * creating an instance with GIT_ODB_BACKEND_INIT. * - * @param opts the `git_odb_backend` struct to initialize. + * @param backend the `git_odb_backend` struct to initialize. * @param version Version the struct; pass `GIT_ODB_BACKEND_VERSION` * @return Zero on success; -1 on failure. */ diff -Nru libgit2-0.22.2/include/git2/sys/refdb_backend.h libgit2-0.23.1/include/git2/sys/refdb_backend.h --- libgit2-0.22.2/include/git2/sys/refdb_backend.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/refdb_backend.h 2015-08-03 18:07:35.000000000 +0000 @@ -175,7 +175,7 @@ * Initializes a `git_refdb_backend` with default values. Equivalent to * creating an instance with GIT_REFDB_BACKEND_INIT. * - * @param opts the `git_refdb_backend` struct to initialize + * @param backend the `git_refdb_backend` struct to initialize * @param version Version of struct; pass `GIT_REFDB_BACKEND_VERSION` * @return Zero on success; -1 on failure. */ diff -Nru libgit2-0.22.2/include/git2/sys/stream.h libgit2-0.23.1/include/git2/sys/stream.h --- libgit2-0.22.2/include/git2/sys/stream.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/stream.h 2015-08-03 18:07:35.000000000 +0000 @@ -29,8 +29,10 @@ int version; int encrypted; + int proxy_support; int (*connect)(struct git_stream *); int (*certificate)(git_cert **, struct git_stream *); + int (*set_proxy)(struct git_stream *, const char *proxy_url); ssize_t (*read)(struct git_stream *, void *, size_t); ssize_t (*write)(struct git_stream *, const char *, size_t, int); int (*close)(struct git_stream *); diff -Nru libgit2-0.22.2/include/git2/sys/transport.h libgit2-0.23.1/include/git2/sys/transport.h --- libgit2-0.22.2/include/git2/sys/transport.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/sys/transport.h 2015-08-03 18:07:35.000000000 +0000 @@ -30,8 +30,6 @@ GIT_TRANSPORTFLAGS_NONE = 0, } git_transport_flags_t; -typedef struct git_transport git_transport; - struct git_transport { unsigned int version; /* Set progress and error callbacks */ @@ -61,7 +59,7 @@ git_transport *transport); /* Executes the push whose context is in the git_push object. */ - int (*push)(git_transport *transport, git_push *push); + int (*push)(git_transport *transport, git_push *push, const git_remote_callbacks *callbacks); /* This function may be called after a successful call to connect(), when * the direction is FETCH. The function performs a negotiation to calculate @@ -142,9 +140,6 @@ */ GIT_EXTERN(int) git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *payload); -/* Signature of a function which creates a transport */ -typedef int (*git_transport_cb)(git_transport **out, git_remote *owner, void *param); - /** * Add a custom transport definition, to be used in addition to the built-in * set of transports that come with libgit2. @@ -289,7 +284,8 @@ /* A function which creates a new subtransport for the smart transport */ typedef int (*git_smart_subtransport_cb)( git_smart_subtransport **out, - git_transport* owner); + git_transport* owner, + void* param); /** * Definition for a "subtransport" @@ -306,6 +302,10 @@ * http:// is stateless, but git:// is not. */ unsigned rpc; + + /** Param of the callback + */ + void* param; } git_smart_subtransport_definition; /* Smart transport subtransports that come with libgit2 */ @@ -321,7 +321,8 @@ */ GIT_EXTERN(int) git_smart_subtransport_http( git_smart_subtransport **out, - git_transport* owner); + git_transport* owner, + void *param); /** * Create an instance of the git subtransport. @@ -332,7 +333,8 @@ */ GIT_EXTERN(int) git_smart_subtransport_git( git_smart_subtransport **out, - git_transport* owner); + git_transport* owner, + void *param); /** * Create an instance of the ssh subtransport. @@ -343,22 +345,8 @@ */ GIT_EXTERN(int) git_smart_subtransport_ssh( git_smart_subtransport **out, - git_transport* owner); - -/** - * Sets a custom transport factory for the remote. The caller can use this - * function to override the transport used for this remote when performing - * network operations. - * - * @param remote the remote to configure - * @param transport_cb the function to use to create a transport - * @param payload opaque parameter passed to transport_cb - * @return 0 or an error code - */ -GIT_EXTERN(int) git_remote_set_transport( - git_remote *remote, - git_transport_cb transport_cb, - void *payload); + git_transport* owner, + void *param); /** @} */ GIT_END_DECL diff -Nru libgit2-0.22.2/include/git2/transport.h libgit2-0.23.1/include/git2/transport.h --- libgit2-0.22.2/include/git2/transport.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/transport.h 2015-08-03 18:07:35.000000000 +0000 @@ -20,6 +20,9 @@ */ GIT_BEGIN_DECL +/** Signature of a function which creates a transport */ +typedef int (*git_transport_cb)(git_transport **out, git_remote *owner, void *param); + /** * Type of SSH host fingerprint */ @@ -105,6 +108,13 @@ * it will ask via this credential type. */ GIT_CREDTYPE_USERNAME = (1u << 5), + + /** + * Credentials read from memory. + * + * Only available for libssh2+OpenSSL for now. + */ + GIT_CREDTYPE_SSH_MEMORY = (1u << 6), } git_credtype_t; /* The base structure for all credential types */ @@ -288,11 +298,28 @@ GIT_EXTERN(int) git_cred_username_new(git_cred **cred, const char *username); /** + * Create a new ssh key credential object reading the keys from memory. + * + * @param out The newly created credential object. + * @param username username to use to authenticate. + * @param publickey The public key of the credential. + * @param privatekey The private key of the credential. + * @param passphrase The passphrase of the credential. + * @return 0 for success or an error code for failure + */ +GIT_EXTERN(int) git_cred_ssh_key_memory_new( + git_cred **out, + const char *username, + const char *publickey, + const char *privatekey, + const char *passphrase); + +/** * Signature of a function which acquires a credential object. * * - cred: The newly created credential object. * - url: The resource for which we are demanding a credential. - * - username_from_url: The username that was embedded in a "user@host" + * - username_from_url: The username that was embedded in a "user\@host" * remote url, or NULL if not included. * - allowed_types: A bitmask stating which cred types are OK to return. * - payload: The payload provided when specifying this callback. diff -Nru libgit2-0.22.2/include/git2/types.h libgit2-0.23.1/include/git2/types.h --- libgit2-0.22.2/include/git2/types.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/types.h 2015-08-03 18:07:35.000000000 +0000 @@ -224,6 +224,12 @@ typedef struct git_remote git_remote; /** + * Interface which represents a transport to communicate with a + * remote. + */ +typedef struct git_transport git_transport; + +/** * Preparation for a push operation. Can be used to configure what to * push and the level of parallelism of the packfile builder. */ @@ -273,10 +279,16 @@ */ typedef int (*git_transport_message_cb)(const char *str, int len, void *payload); + /** * Type of host certificate structure that is passed to the check callback */ typedef enum git_cert_t { + /** + * No information about the certificate is available. This may + * happen when using curl. + */ + GIT_CERT_NONE, /** * The `data` argument to the callback will be a pointer to * the DER-encoded data. @@ -287,6 +299,13 @@ * `git_cert_hostkey` structure. */ GIT_CERT_HOSTKEY_LIBSSH2, + /** + * The `data` argument to the callback will be a pointer to a + * `git_strarray` with `name:content` strings containing + * information about the certificate. This is used when using + * curl. + */ + GIT_CERT_STRARRAY, } git_cert_t; /** @@ -302,9 +321,7 @@ /** * Callback for the user's custom certificate checks. * - * @param type The type of certificate or host info, SSH or X.509 - * @param data The data for the certificate or host info - * @param len The size of the certificate or host info + * @param cert The host certificate * @param valid Whether the libgit2 checks (OpenSSL or WinHTTP) think * this certificate is valid * @param host Hostname of the host libgit2 connected to @@ -332,7 +349,6 @@ * * The values are: * - * - GIT_SUBMODULE_UPDATE_RESET: reset to the on-disk value. * - GIT_SUBMODULE_UPDATE_CHECKOUT: the default; when a submodule is * updated, checkout the new detached HEAD to the submodule directory. * - GIT_SUBMODULE_UPDATE_REBASE: update by rebasing the current checked @@ -345,8 +361,6 @@ * when we don't want any particular update rule to be specified. */ typedef enum { - GIT_SUBMODULE_UPDATE_RESET = -1, - GIT_SUBMODULE_UPDATE_CHECKOUT = 1, GIT_SUBMODULE_UPDATE_REBASE = 2, GIT_SUBMODULE_UPDATE_MERGE = 3, @@ -369,7 +383,7 @@ * * The values are: * - * - GIT_SUBMODULE_IGNORE_RESET: reset to the on-disk value. + * - GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration * - GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an * untracked file, will mark the submodule as dirty. Ignored files are * still ignored, of course. @@ -383,14 +397,12 @@ * when we don't want any particular ignore rule to be specified. */ typedef enum { - GIT_SUBMODULE_IGNORE_RESET = -1, /**< reset to on-disk value */ + GIT_SUBMODULE_IGNORE_UNSPECIFIED = -1, /**< use the submodule's configuration */ GIT_SUBMODULE_IGNORE_NONE = 1, /**< any change or untracked == dirty */ GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /**< dirty if tracked files change */ GIT_SUBMODULE_IGNORE_DIRTY = 3, /**< only dirty if HEAD moved */ GIT_SUBMODULE_IGNORE_ALL = 4, /**< never dirty */ - - GIT_SUBMODULE_IGNORE_DEFAULT = 0 } git_submodule_ignore_t; /** @@ -398,20 +410,26 @@ * * Represent the value of `submodule.$name.fetchRecurseSubmodules` * - * * GIT_SUBMODULE_RECURSE_RESET - reset to the on-disk value * * GIT_SUBMODULE_RECURSE_NO - do no recurse into submodules * * GIT_SUBMODULE_RECURSE_YES - recurse into submodules * * GIT_SUBMODULE_RECURSE_ONDEMAND - recurse into submodules only when * commit not already in local clone */ typedef enum { - GIT_SUBMODULE_RECURSE_RESET = -1, - GIT_SUBMODULE_RECURSE_NO = 0, GIT_SUBMODULE_RECURSE_YES = 1, GIT_SUBMODULE_RECURSE_ONDEMAND = 2, } git_submodule_recurse_t; +/** A type to write in a streaming fashion, for example, for filters. */ +typedef struct git_writestream git_writestream; + +struct git_writestream { + int (*write)(git_writestream *stream, const char *buffer, size_t len); + int (*close)(git_writestream *stream); + void (*free)(git_writestream *stream); +}; + /** @} */ GIT_END_DECL diff -Nru libgit2-0.22.2/include/git2/version.h libgit2-0.23.1/include/git2/version.h --- libgit2-0.22.2/include/git2/version.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2/version.h 2015-08-03 18:07:35.000000000 +0000 @@ -7,11 +7,12 @@ #ifndef INCLUDE_git_version_h__ #define INCLUDE_git_version_h__ -#define LIBGIT2_VERSION "0.22.2" +#define LIBGIT2_VERSION "0.23.1" #define LIBGIT2_VER_MAJOR 0 -#define LIBGIT2_VER_MINOR 22 -#define LIBGIT2_VER_REVISION 2 +#define LIBGIT2_VER_MINOR 23 +#define LIBGIT2_VER_REVISION 1 +#define LIBGIT2_VER_PATCH 0 -#define LIBGIT2_SOVERSION 22 +#define LIBGIT2_SOVERSION 23 #endif diff -Nru libgit2-0.22.2/include/git2.h libgit2-0.23.1/include/git2.h --- libgit2-0.22.2/include/git2.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/include/git2.h 2015-08-03 18:07:35.000000000 +0000 @@ -40,7 +40,6 @@ #include "git2/pack.h" #include "git2/patch.h" #include "git2/pathspec.h" -#include "git2/push.h" #include "git2/rebase.h" #include "git2/refdb.h" #include "git2/reflog.h" @@ -58,6 +57,7 @@ #include "git2/submodule.h" #include "git2/tag.h" #include "git2/transport.h" +#include "git2/transaction.h" #include "git2/tree.h" #include "git2/types.h" #include "git2/version.h" diff -Nru libgit2-0.22.2/libgit2.pc.in libgit2-0.23.1/libgit2.pc.in --- libgit2-0.22.2/libgit2.pc.in 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/libgit2.pc.in 2015-08-03 18:07:35.000000000 +0000 @@ -4,7 +4,9 @@ Name: libgit2 Description: The git library, take 2 Version: @LIBGIT2_VERSION_STRING@ -Requires.private: @LIBGIT2_PC_REQUIRES@ -Libs.private: @LIBGIT2_PC_LIBS@ + Libs: -L${libdir} -lgit2 +Libs.private: @LIBGIT2_PC_LIBS@ +Requires.private: @LIBGIT2_PC_REQUIRES@ + Cflags: -I${includedir} diff -Nru libgit2-0.22.2/README.md libgit2-0.23.1/README.md --- libgit2-0.22.2/README.md 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/README.md 2015-08-03 18:07:35.000000000 +0000 @@ -1,8 +1,8 @@ libgit2 - the Git linkable library ================================== -[![Travis Build Status](https://secure.travis-ci.org/libgit2/libgit2.png?branch=master)](http://travis-ci.org/libgit2/libgit2) -[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/gnjsdi9r48cfoveg/branch/master?svg=true)](https://ci.appveyor.com/project/nulltoken/libgit2/branch/master) +[![Travis Build Status](https://secure.travis-ci.org/libgit2/libgit2.svg?branch=master)](http://travis-ci.org/libgit2/libgit2) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/xvof5b4t5480a2q3/branch/master?svg=true)](https://ci.appveyor.com/project/libgit2/libgit2/branch/master) [![Coverity Scan Build Status](https://scan.coverity.com/projects/639/badge.svg)](https://scan.coverity.com/projects/639) `libgit2` is a portable, pure C implementation of the Git core methods @@ -70,7 +70,10 @@ git_libgit2_shutdown(); -will free the resources. +will free the resources. Note that if you have worker threads, you should +call `git_libgit2_shutdown` *after* those threads have exited. If you +require assistance coordinating this, simply have the worker threads call +`git_libgit2_init` at startup and `git_libgit2_shutdown` at shutdown. Threading ========= @@ -85,7 +88,7 @@ they should be installed by default on all systems. Under Windows, libgit2 uses the native Windows API for threading. -The `libgit2` library is built using [CMake]() (version 2.6 or newer) on all platforms. +The `libgit2` library is built using [CMake]() (version 2.8 or newer) on all platforms. On most systems you can build the library using the following commands @@ -160,7 +163,7 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -Add `-DCMAKE_TOOLCHAIN_FILE={pathToToolchainFile} -DANDROID=1` to cmake command +Add `-DCMAKE_TOOLCHAIN_FILE={pathToToolchainFile}` to cmake command when configuring. Language Bindings @@ -173,7 +176,7 @@ * Chicken Scheme * chicken-git * D - * dlibgit + * dlibgit * Delphi * GitForDelphi * Erlang @@ -198,7 +201,7 @@ * Objective-C * objective-git * OCaml - * libgit2-ocaml + * ocaml-libgit2 * Parrot Virtual Machine * parrot-libgit2 * Perl @@ -215,6 +218,8 @@ * Rugged * Rust * git2-rs +* Swift + * Gift * Vala * libgit2.vapi diff -Nru libgit2-0.22.2/script/appveyor-mingw.sh libgit2-0.23.1/script/appveyor-mingw.sh --- libgit2-0.22.2/script/appveyor-mingw.sh 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/script/appveyor-mingw.sh 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,23 @@ +#!/bin/sh +set -e +cd `dirname "$0"`/.. +if [ "$ARCH" = "32" ]; then + echo 'C:\MinGW\ /MinGW' > /etc/fstab +elif [ "$ARCH" = "i686" ]; then + f=i686-4.9.2-release-win32-sjlj-rt_v3-rev1.7z + if ! [ -e $f ]; then + curl -LsSO http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/sjlj/$f + fi + 7z x $f > /dev/null + mv mingw32 /MinGW +else + f=x86_64-4.9.2-release-win32-seh-rt_v3-rev1.7z + if ! [ -e $f ]; then + curl -LsSO http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.2/threads-win32/seh/$f + fi + 7z x $f > /dev/null + mv mingw64 /MinGW +fi +cd build +cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON .. -G"$GENERATOR" +cmake --build . --config RelWithDebInfo diff -Nru libgit2-0.22.2/script/cibuild.sh libgit2-0.23.1/script/cibuild.sh --- libgit2-0.22.2/script/cibuild.sh 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/script/cibuild.sh 2015-08-03 18:07:35.000000000 +0000 @@ -6,17 +6,25 @@ exit $?; fi +mkdir _build +cd _build +# shellcheck disable=SC2086 +cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS || exit $? +make -j2 install || exit $? + +# If this platform doesn't support test execution, bail out now +if [ -n "$SKIP_TESTS" ]; +then + exit $?; +fi + # Create a test repo which we can use for the online::push tests mkdir "$HOME"/_temp git init --bare "$HOME"/_temp/test.git git daemon --listen=localhost --export-all --enable=receive-pack --base-path="$HOME"/_temp "$HOME"/_temp 2>/dev/null & export GITTEST_REMOTE_URL="git://localhost/test.git" -mkdir _build -cd _build -# shellcheck disable=SC2086 -cmake .. -DCMAKE_INSTALL_PREFIX=../_install $OPTIONS || exit $? -make -j2 install || exit $? +# Run the test suite ctest -V . || exit $? # Now that we've tested the raw git protocol, let's set up ssh to we @@ -26,8 +34,6 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then echo 'PasswordAuthentication yes' | sudo tee -a /etc/sshd_config -else - sudo start ssh fi ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" -q @@ -45,8 +51,8 @@ if [ -e ./libgit2_clar ]; then ./libgit2_clar -sonline::push -sonline::clone::ssh_cert && - ./libgit2_clar -sonline::clone::ssh_with_paths + ./libgit2_clar -sonline::clone::ssh_with_paths || exit $? if [ "$TRAVIS_OS_NAME" = "linux" ]; then - ./libgit2_clar -sonline::clone::cred_callback + ./libgit2_clar -sonline::clone::cred_callback || exit $? fi fi diff -Nru libgit2-0.22.2/script/install-deps-linux.sh libgit2-0.23.1/script/install-deps-linux.sh --- libgit2-0.22.2/script/install-deps-linux.sh 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/script/install-deps-linux.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -#!/bin/sh - -set -x - -sudo apt-get -qq update && -sudo apt-get -qq install cmake libssh2-1-dev openssh-client openssh-server diff -Nru libgit2-0.22.2/script/toolchain-mingw32.cmake libgit2-0.23.1/script/toolchain-mingw32.cmake --- libgit2-0.22.2/script/toolchain-mingw32.cmake 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/script/toolchain-mingw32.cmake 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,13 @@ +# CMake toolchain file for Win32 cross-compile +SET(CMAKE_SYSTEM_NAME Windows) + +SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc) +SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres) + +SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc) + +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + +SET(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig) diff -Nru libgit2-0.22.2/src/annotated_commit.c libgit2-0.23.1/src/annotated_commit.c --- libgit2-0.22.2/src/annotated_commit.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/annotated_commit.c 2015-08-03 18:07:35.000000000 +0000 @@ -12,6 +12,7 @@ #include "git2/refs.h" #include "git2/repository.h" #include "git2/annotated_commit.h" +#include "git2/revparse.h" static int annotated_commit_init( git_annotated_commit **out, @@ -96,6 +97,33 @@ return annotated_commit_init(out, repo, id, branch_name, remote_url); } +int git_annotated_commit_from_revspec( + git_annotated_commit **out, + git_repository *repo, + const char *revspec) +{ + git_object *obj, *commit; + int error; + + assert(out && repo && revspec); + + if ((error = git_revparse_single(&obj, repo, revspec)) < 0) + return error; + + if ((error = git_object_peel(&commit, obj, GIT_OBJ_COMMIT))) { + git_object_free(obj); + return error; + } + + error = annotated_commit_init(out, repo, git_object_id(commit), revspec, NULL); + + git_object_free(obj); + git_object_free(commit); + + return error; +} + + const git_oid *git_annotated_commit_id( const git_annotated_commit *annotated_commit) { diff -Nru libgit2-0.22.2/src/array.h libgit2-0.23.1/src/array.h --- libgit2-0.22.2/src/array.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/array.h 2015-08-03 18:07:35.000000000 +0000 @@ -23,7 +23,7 @@ * * typedef git_array_t(my_struct) my_struct_array_t; */ -#define git_array_t(type) struct { type *ptr; uint32_t size, asize; } +#define git_array_t(type) struct { type *ptr; size_t size, asize; } #define GIT_ARRAY_INIT { NULL, 0, 0 } @@ -45,15 +45,26 @@ GIT_INLINE(void *) git_array_grow(void *_a, size_t item_size) { volatile git_array_generic_t *a = _a; - uint32_t new_size = (a->size < 8) ? 8 : a->asize * 3 / 2; - char *new_array = git__realloc(a->ptr, new_size * item_size); - if (!new_array) { - git_array_clear(*a); - return NULL; + size_t new_size; + char *new_array; + + if (a->size < 8) { + new_size = 8; } else { - a->ptr = new_array; a->asize = new_size; a->size++; - return a->ptr + (a->size - 1) * item_size; + if (GIT_MULTIPLY_SIZET_OVERFLOW(&new_size, a->size, 3)) + goto on_oom; + new_size /= 2; } + + if ((new_array = git__reallocarray(a->ptr, new_size, item_size)) == NULL) + goto on_oom; + + a->ptr = new_array; a->asize = new_size; a->size++; + return a->ptr + (a->size - 1) * item_size; + +on_oom: + git_array_clear(*a); + return NULL; } #define git_array_alloc(a) \ diff -Nru libgit2-0.22.2/src/attr.c libgit2-0.23.1/src/attr.c --- libgit2-0.22.2/src/attr.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/attr.c 2015-08-03 18:07:35.000000000 +0000 @@ -7,7 +7,7 @@ #include "git2/oid.h" #include -GIT__USE_STRMAP; +GIT__USE_STRMAP const char *git_attr__true = "[internal]__TRUE__"; const char *git_attr__false = "[internal]__FALSE__"; @@ -29,6 +29,7 @@ static int collect_attr_files( git_repository *repo, + git_attr_session *attr_session, uint32_t flags, const char *path, git_vector *files); @@ -54,10 +55,10 @@ *value = NULL; - if (git_attr_path__init(&path, pathname, git_repository_workdir(repo)) < 0) + if (git_attr_path__init(&path, pathname, git_repository_workdir(repo), GIT_DIR_FLAG_UNKNOWN) < 0) return -1; - if ((error = collect_attr_files(repo, flags, pathname, &files)) < 0) + if ((error = collect_attr_files(repo, NULL, flags, pathname, &files)) < 0) goto cleanup; memset(&attr, 0, sizeof(attr)); @@ -90,9 +91,10 @@ git_attr_assignment *found; } attr_get_many_info; -int git_attr_get_many( +int git_attr_get_many_with_session( const char **values, git_repository *repo, + git_attr_session *attr_session, uint32_t flags, const char *pathname, size_t num_attr, @@ -112,10 +114,10 @@ assert(values && repo && names); - if (git_attr_path__init(&path, pathname, git_repository_workdir(repo)) < 0) + if (git_attr_path__init(&path, pathname, git_repository_workdir(repo), GIT_DIR_FLAG_UNKNOWN) < 0) return -1; - if ((error = collect_attr_files(repo, flags, pathname, &files)) < 0) + if ((error = collect_attr_files(repo, attr_session, flags, pathname, &files)) < 0) goto cleanup; info = git__calloc(num_attr, sizeof(attr_get_many_info)); @@ -161,6 +163,17 @@ return error; } +int git_attr_get_many( + const char **values, + git_repository *repo, + uint32_t flags, + const char *pathname, + size_t num_attr, + const char **names) +{ + return git_attr_get_many_with_session( + values, repo, NULL, flags, pathname, num_attr, names); +} int git_attr_foreach( git_repository *repo, @@ -180,10 +193,10 @@ assert(repo && callback); - if (git_attr_path__init(&path, pathname, git_repository_workdir(repo)) < 0) + if (git_attr_path__init(&path, pathname, git_repository_workdir(repo), GIT_DIR_FLAG_UNKNOWN) < 0) return -1; - if ((error = collect_attr_files(repo, flags, pathname, &files)) < 0 || + if ((error = collect_attr_files(repo, NULL, flags, pathname, &files)) < 0 || (error = git_strmap_alloc(&seen)) < 0) goto cleanup; @@ -219,6 +232,7 @@ static int preload_attr_file( git_repository *repo, + git_attr_session *attr_session, git_attr_file_source source, const char *base, const char *file) @@ -229,19 +243,60 @@ if (!file) return 0; if (!(error = git_attr_cache__get( - &preload, repo, source, base, file, git_attr_file__parse_buffer))) + &preload, repo, attr_session, source, base, file, git_attr_file__parse_buffer))) git_attr_file__free(preload); return error; } -static int attr_setup(git_repository *repo) +static int system_attr_file( + git_buf *out, + git_attr_session *attr_session) +{ + int error; + + if (!attr_session) { + error = git_sysdir_find_system_file(out, GIT_ATTR_FILE_SYSTEM); + + if (error == GIT_ENOTFOUND) + giterr_clear(); + + return error; + } + + if (!attr_session->init_sysdir) { + error = git_sysdir_find_system_file(&attr_session->sysdir, GIT_ATTR_FILE_SYSTEM); + + if (error == GIT_ENOTFOUND) + giterr_clear(); + else if (error) + return error; + + attr_session->init_sysdir = 1; + } + + if (attr_session->sysdir.size == 0) + return GIT_ENOTFOUND; + + /* We can safely provide a git_buf with no allocation (asize == 0) to + * a consumer. This allows them to treat this as a regular `git_buf`, + * but their call to `git_buf_free` will not attempt to free it. + */ + git_buf_attach_notowned( + out, attr_session->sysdir.ptr, attr_session->sysdir.size); + return 0; +} + +static int attr_setup(git_repository *repo, git_attr_session *attr_session) { int error = 0; const char *workdir = git_repository_workdir(repo); git_index *idx = NULL; git_buf sys = GIT_BUF_INIT; + if (attr_session && attr_session->init_setup) + return 0; + if ((error = git_attr_cache__init(repo)) < 0) return error; @@ -249,39 +304,40 @@ * definitions will be available for later file parsing */ - if (!(error = git_sysdir_find_system_file(&sys, GIT_ATTR_FILE_SYSTEM))) { + error = system_attr_file(&sys, attr_session); + + if (error == 0) error = preload_attr_file( - repo, GIT_ATTR_FILE__FROM_FILE, NULL, sys.ptr); - git_buf_free(&sys); - } - if (error < 0) { - if (error == GIT_ENOTFOUND) { - giterr_clear(); - error = 0; - } else - return error; - } + repo, attr_session, GIT_ATTR_FILE__FROM_FILE, NULL, sys.ptr); + + if (error != GIT_ENOTFOUND) + return error; + + git_buf_free(&sys); if ((error = preload_attr_file( - repo, GIT_ATTR_FILE__FROM_FILE, + repo, attr_session, GIT_ATTR_FILE__FROM_FILE, NULL, git_repository_attr_cache(repo)->cfg_attr_file)) < 0) return error; if ((error = preload_attr_file( - repo, GIT_ATTR_FILE__FROM_FILE, + repo, attr_session, GIT_ATTR_FILE__FROM_FILE, git_repository_path(repo), GIT_ATTR_FILE_INREPO)) < 0) return error; if (workdir != NULL && (error = preload_attr_file( - repo, GIT_ATTR_FILE__FROM_FILE, workdir, GIT_ATTR_FILE)) < 0) + repo, attr_session, GIT_ATTR_FILE__FROM_FILE, workdir, GIT_ATTR_FILE)) < 0) return error; if ((error = git_repository_index__weakptr(&idx, repo)) < 0 || (error = preload_attr_file( - repo, GIT_ATTR_FILE__FROM_INDEX, NULL, GIT_ATTR_FILE)) < 0) + repo, attr_session, GIT_ATTR_FILE__FROM_INDEX, NULL, GIT_ATTR_FILE)) < 0) return error; + if (attr_session) + attr_session->init_setup = 1; + return error; } @@ -321,6 +377,7 @@ typedef struct { git_repository *repo; + git_attr_session *attr_session; uint32_t flags; const char *workdir; git_index *index; @@ -356,6 +413,7 @@ static int push_attr_file( git_repository *repo, + git_attr_session *attr_session, git_vector *list, git_attr_file_source source, const char *base, @@ -364,8 +422,9 @@ int error = 0; git_attr_file *file = NULL; - error = git_attr_cache__get( - &file, repo, source, base, filename, git_attr_file__parse_buffer); + error = git_attr_cache__get(&file, repo, attr_session, + source, base, filename, git_attr_file__parse_buffer); + if (error < 0) return error; @@ -387,8 +446,8 @@ info->flags, info->workdir != NULL, info->index != NULL, src); for (i = 0; !error && i < n_src; ++i) - error = push_attr_file( - info->repo, info->files, src[i], path, GIT_ATTR_FILE); + error = push_attr_file(info->repo, info->attr_session, + info->files, src[i], path, GIT_ATTR_FILE); return error; } @@ -407,6 +466,7 @@ static int collect_attr_files( git_repository *repo, + git_attr_session *attr_session, uint32_t flags, const char *path, git_vector *files) @@ -416,7 +476,7 @@ const char *workdir = git_repository_workdir(repo); attr_walk_up_info info = { NULL }; - if ((error = attr_setup(repo)) < 0) + if ((error = attr_setup(repo, attr_session)) < 0) return error; /* Resolve path in a non-bare repo */ @@ -435,12 +495,13 @@ */ error = push_attr_file( - repo, files, GIT_ATTR_FILE__FROM_FILE, + repo, attr_session, files, GIT_ATTR_FILE__FROM_FILE, git_repository_path(repo), GIT_ATTR_FILE_INREPO); if (error < 0) goto cleanup; - info.repo = repo; + info.repo = repo; + info.attr_session = attr_session; info.flags = flags; info.workdir = workdir; if (git_repository_index__weakptr(&info.index, repo) < 0) @@ -457,21 +518,21 @@ if (git_repository_attr_cache(repo)->cfg_attr_file != NULL) { error = push_attr_file( - repo, files, GIT_ATTR_FILE__FROM_FILE, + repo, attr_session, files, GIT_ATTR_FILE__FROM_FILE, NULL, git_repository_attr_cache(repo)->cfg_attr_file); if (error < 0) goto cleanup; } if ((flags & GIT_ATTR_CHECK_NO_SYSTEM) == 0) { - error = git_sysdir_find_system_file(&dir, GIT_ATTR_FILE_SYSTEM); + error = system_attr_file(&dir, attr_session); + if (!error) error = push_attr_file( - repo, files, GIT_ATTR_FILE__FROM_FILE, NULL, dir.ptr); - else if (error == GIT_ENOTFOUND) { - giterr_clear(); + repo, attr_session, files, GIT_ATTR_FILE__FROM_FILE, + NULL, dir.ptr); + else if (error == GIT_ENOTFOUND) error = 0; - } } cleanup: diff -Nru libgit2-0.22.2/src/attrcache.c libgit2-0.23.1/src/attrcache.c --- libgit2-0.22.2/src/attrcache.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/attrcache.c 2015-08-03 18:07:35.000000000 +0000 @@ -5,7 +5,7 @@ #include "sysdir.h" #include "ignore.h" -GIT__USE_STRMAP; +GIT__USE_STRMAP GIT_INLINE(int) attr_cache_lock(git_attr_cache *cache) { @@ -149,6 +149,7 @@ git_attr_file **out_file, git_attr_file_entry **out_entry, git_repository *repo, + git_attr_session *attr_session, git_attr_file_source source, const char *base, const char *filename) @@ -162,9 +163,12 @@ /* join base and path as needed */ if (base != NULL && git_path_root(filename) < 0) { - if (git_buf_joinpath(&path, base, filename) < 0) + git_buf *p = attr_session ? &attr_session->tmp : &path; + + if (git_buf_joinpath(p, base, filename) < 0) return -1; - filename = path.ptr; + + filename = p->ptr; } relfile = filename; @@ -196,6 +200,7 @@ int git_attr_cache__get( git_attr_file **out, git_repository *repo, + git_attr_session *attr_session, git_attr_file_source source, const char *base, const char *filename, @@ -207,12 +212,12 @@ git_attr_file *file = NULL, *updated = NULL; if ((error = attr_cache_lookup( - &file, &entry, repo, source, base, filename)) < 0) + &file, &entry, repo, attr_session, source, base, filename)) < 0) return error; /* load file if we don't have one or if existing one is out of date */ - if (!file || (error = git_attr_file__out_of_date(repo, file)) > 0) - error = git_attr_file__load(&updated, repo, entry, source, parser); + if (!file || (error = git_attr_file__out_of_date(repo, attr_session, file)) > 0) + error = git_attr_file__load(&updated, repo, attr_session, entry, source, parser); /* if we loaded the file, insert into and/or update cache */ if (updated) { @@ -271,7 +276,7 @@ { git_buf buf = GIT_BUF_INIT; int error; - const git_config_entry *entry = NULL; + git_config_entry *entry = NULL; *out = NULL; @@ -291,6 +296,7 @@ else if (!git_sysdir_find_xdg_file(&buf, fallback)) *out = git_buf_detach(&buf); + git_config_entry_free(entry); git_buf_free(&buf); return error; diff -Nru libgit2-0.22.2/src/attrcache.h libgit2-0.23.1/src/attrcache.h --- libgit2-0.22.2/src/attrcache.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/attrcache.h 2015-08-03 18:07:35.000000000 +0000 @@ -31,6 +31,7 @@ extern int git_attr_cache__get( git_attr_file **file, git_repository *repo, + git_attr_session *attr_session, git_attr_file_source source, const char *base, const char *filename, diff -Nru libgit2-0.22.2/src/attr_file.c libgit2-0.23.1/src/attr_file.c --- libgit2-0.22.2/src/attr_file.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/attr_file.c 2015-08-03 18:07:35.000000000 +0000 @@ -96,6 +96,7 @@ int git_attr_file__load( git_attr_file **out, git_repository *repo, + git_attr_session *attr_session, git_attr_file_entry *entry, git_attr_file_source source, git_attr_file_parser parser) @@ -105,6 +106,7 @@ git_buf content = GIT_BUF_INIT; git_attr_file *file; struct stat st; + bool nonexistent = false; *out = NULL; @@ -127,22 +129,16 @@ case GIT_ATTR_FILE__FROM_FILE: { int fd; - if (p_stat(entry->fullpath, &st) < 0) - return git_path_set_error(errno, entry->fullpath, "stat"); - if (S_ISDIR(st.st_mode)) - return GIT_ENOTFOUND; - - /* For open or read errors, return ENOTFOUND to skip item */ + /* For open or read errors, pretend that we got ENOTFOUND. */ /* TODO: issue warning when warning API is available */ - if ((fd = git_futils_open_ro(entry->fullpath)) < 0) - return GIT_ENOTFOUND; - - error = git_futils_readbuffer_fd(&content, fd, (size_t)st.st_size); - p_close(fd); - - if (error < 0) - return GIT_ENOTFOUND; + if (p_stat(entry->fullpath, &st) < 0 || + S_ISDIR(st.st_mode) || + (fd = git_futils_open_ro(entry->fullpath)) < 0 || + (error = git_futils_readbuffer_fd(&content, fd, (size_t)st.st_size)) < 0) + nonexistent = true; + else + p_close(fd); break; } @@ -154,13 +150,21 @@ if ((error = git_attr_file__new(&file, entry, source)) < 0) goto cleanup; + /* store the key of the attr_reader; don't bother with cache + * invalidation during the same attr reader session. + */ + if (attr_session) + file->session_key = attr_session->key; + if (parser && (error = parser(repo, file, git_buf_cstr(&content))) < 0) { git_attr_file__free(file); goto cleanup; } - /* write cache breaker */ - if (source == GIT_ATTR_FILE__FROM_INDEX) + /* write cache breakers */ + if (nonexistent) + file->nonexistent = 1; + else if (source == GIT_ATTR_FILE__FROM_INDEX) git_oid_cpy(&file->cache_data.oid, git_blob_id(blob)); else if (source == GIT_ATTR_FILE__FROM_FILE) git_futils_filestamp_set_from_stat(&file->cache_data.stamp, &st); @@ -175,11 +179,22 @@ return error; } -int git_attr_file__out_of_date(git_repository *repo, git_attr_file *file) +int git_attr_file__out_of_date( + git_repository *repo, + git_attr_session *attr_session, + git_attr_file *file) { if (!file) return 1; + /* we are never out of date if we just created this data in the same + * attr_session; otherwise, nonexistent files must be invalidated + */ + if (attr_session && attr_session->key == file->session_key) + return 0; + else if (file->nonexistent) + return 1; + switch (file->source) { case GIT_ATTR_FILE__IN_MEMORY: return 0; @@ -344,6 +359,7 @@ git_attr_fnmatch *match, git_attr_path *path) { + const char *relpath = path->path; const char *filename; int flags = 0; @@ -360,6 +376,8 @@ if (git__prefixcmp(path->path, match->containing_dir)) return 0; } + + relpath += match->containing_dir_length; } if (match->flags & GIT_ATTR_FNMATCH_ICASE) @@ -368,7 +386,7 @@ flags |= FNM_LEADING_DIR; if (match->flags & GIT_ATTR_FNMATCH_FULLPATH) { - filename = path->path; + filename = relpath; flags |= FNM_PATHNAME; } else { filename = path->basename; @@ -378,28 +396,33 @@ } if ((match->flags & GIT_ATTR_FNMATCH_DIRECTORY) && !path->is_dir) { - int matchval; + bool samename; /* for attribute checks or root ignore checks, fail match */ if (!(match->flags & GIT_ATTR_FNMATCH_IGNORE) || path->basename == path->path) return false; - /* for ignore checks, use container of current item for check */ - path->basename[-1] = '\0'; flags |= FNM_LEADING_DIR; - matchval = p_fnmatch(match->pattern, path->path, flags); - path->basename[-1] = '/'; - return (matchval != FNM_NOMATCH); + + /* fail match if this is a file with same name as ignored folder */ + samename = (match->flags & GIT_ATTR_FNMATCH_ICASE) ? + !strcasecmp(match->pattern, relpath) : + !strcmp(match->pattern, relpath); + + if (samename) + return false; + + return (p_fnmatch(match->pattern, relpath, flags) != FNM_NOMATCH); } /* if path is a directory prefix of a negated pattern, then match */ if ((match->flags & GIT_ATTR_FNMATCH_NEGATIVE) && path->is_dir) { - size_t pathlen = strlen(path->path); + size_t pathlen = strlen(relpath); bool prefixed = (pathlen <= match->length) && ((match->flags & GIT_ATTR_FNMATCH_ICASE) ? - !strncasecmp(match->pattern, path->path, pathlen) : - !strncmp(match->pattern, path->path, pathlen)); + !strncasecmp(match->pattern, relpath, pathlen) : + !strncmp(match->pattern, relpath, pathlen)); if (prefixed && git_path_at_end_of_segment(&match->pattern[pathlen])) return true; @@ -435,7 +458,7 @@ } int git_attr_path__init( - git_attr_path *info, const char *path, const char *base) + git_attr_path *info, const char *path, const char *base, git_dir_flag dir_flag) { ssize_t root; @@ -466,7 +489,21 @@ if (!info->basename || !*info->basename) info->basename = info->path; - info->is_dir = (int)git_path_isdir(info->full.ptr); + switch (dir_flag) + { + case GIT_DIR_FLAG_FALSE: + info->is_dir = 0; + break; + + case GIT_DIR_FLAG_TRUE: + info->is_dir = 1; + break; + + case GIT_DIR_FLAG_UNKNOWN: + default: + info->is_dir = (int)git_path_isdir(info->full.ptr); + break; + } return 0; } @@ -604,7 +641,7 @@ } if (context) { - char *slash = strchr(context, '/'); + char *slash = strrchr(context, '/'); size_t len; if (slash) { /* include the slash for easier matching */ @@ -614,27 +651,7 @@ } } - if ((spec->flags & GIT_ATTR_FNMATCH_FULLPATH) != 0 && - context != NULL && git_path_root(pattern) < 0) - { - /* use context path minus the trailing filename */ - char *slash = strrchr(context, '/'); - size_t contextlen = slash ? slash - context + 1 : 0; - - /* given an unrooted fullpath match from a file inside a repo, - * prefix the pattern with the relative directory of the source file - */ - spec->pattern = git_pool_malloc( - pool, (uint32_t)(contextlen + spec->length + 1)); - if (spec->pattern) { - memcpy(spec->pattern, context, contextlen); - memcpy(spec->pattern + contextlen, pattern, spec->length); - spec->length += contextlen; - spec->pattern[spec->length] = '\0'; - } - } else { - spec->pattern = git_pool_strndup(pool, pattern, spec->length); - } + spec->pattern = git_pool_strndup(pool, pattern, spec->length); if (!spec->pattern) { *base = git__next_line(pattern); @@ -831,3 +848,22 @@ git__free(rule); } +int git_attr_session__init(git_attr_session *session, git_repository *repo) +{ + assert(repo); + + session->key = git_atomic_inc(&repo->attr_session_key); + + return 0; +} + +void git_attr_session__free(git_attr_session *session) +{ + if (!session) + return; + + git_buf_free(&session->sysdir); + git_buf_free(&session->tmp); + + memset(session, 0, sizeof(git_attr_session)); +} diff -Nru libgit2-0.22.2/src/attr_file.h libgit2-0.23.1/src/attr_file.h --- libgit2-0.22.2/src/attr_file.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/attr_file.h 2015-08-03 18:07:35.000000000 +0000 @@ -38,11 +38,11 @@ GIT_ATTR_FNMATCH_ALLOWMACRO | GIT_ATTR_FNMATCH_NOLEADINGDIR) typedef enum { - GIT_ATTR_FILE__IN_MEMORY = 0, - GIT_ATTR_FILE__FROM_FILE = 1, - GIT_ATTR_FILE__FROM_INDEX = 2, + GIT_ATTR_FILE__IN_MEMORY = 0, + GIT_ATTR_FILE__FROM_FILE = 1, + GIT_ATTR_FILE__FROM_INDEX = 2, - GIT_ATTR_FILE_NUM_SOURCES = 3 + GIT_ATTR_FILE_NUM_SOURCES = 3 } git_attr_file_source; extern const char *git_attr__true; @@ -84,6 +84,8 @@ git_attr_file_source source; git_vector rules; /* vector of or */ git_pool pool; + unsigned int nonexistent:1; + int session_key; union { git_oid oid; git_futils_filestamp stamp; @@ -96,11 +98,6 @@ char fullpath[GIT_FLEX_ARRAY]; }; -typedef int (*git_attr_file_parser)( - git_repository *repo, - git_attr_file *file, - const char *data); - typedef struct { git_buf full; char *path; @@ -108,6 +105,35 @@ int is_dir; } git_attr_path; +/* A git_attr_session can provide an "instance" of reading, to prevent cache + * invalidation during a single operation instance (like checkout). + */ + +typedef struct { + int key; + unsigned int init_setup:1, + init_sysdir:1; + git_buf sysdir; + git_buf tmp; +} git_attr_session; + +extern int git_attr_session__init(git_attr_session *attr_session, git_repository *repo); +extern void git_attr_session__free(git_attr_session *session); + +extern int git_attr_get_many_with_session( + const char **values_out, + git_repository *repo, + git_attr_session *attr_session, + uint32_t flags, + const char *path, + size_t num_attr, + const char **names); + +typedef int (*git_attr_file_parser)( + git_repository *repo, + git_attr_file *file, + const char *data); + /* * git_attr_file API */ @@ -122,6 +148,7 @@ int git_attr_file__load( git_attr_file **out, git_repository *repo, + git_attr_session *attr_session, git_attr_file_entry *ce, git_attr_file_source source, git_attr_file_parser parser); @@ -130,7 +157,7 @@ git_attr_file **out, const char *path); int git_attr_file__out_of_date( - git_repository *repo, git_attr_file *file); + git_repository *repo, git_attr_session *session, git_attr_file *file); int git_attr_file__parse_buffer( git_repository *repo, git_attr_file *attrs, const char *data); @@ -175,8 +202,10 @@ extern git_attr_assignment *git_attr_rule__lookup_assignment( git_attr_rule *rule, const char *name); +typedef enum { GIT_DIR_FLAG_TRUE = 1, GIT_DIR_FLAG_FALSE = 0, GIT_DIR_FLAG_UNKNOWN = -1 } git_dir_flag; + extern int git_attr_path__init( - git_attr_path *info, const char *path, const char *base); + git_attr_path *info, const char *path, const char *base, git_dir_flag is_dir); extern void git_attr_path__free(git_attr_path *info); diff -Nru libgit2-0.22.2/src/blame.c libgit2-0.23.1/src/blame.c --- libgit2-0.22.2/src/blame.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/blame.c 2015-08-03 18:07:35.000000000 +0000 @@ -76,6 +76,10 @@ hunk->lines_in_hunk, hunk->orig_start_line_number, hunk->orig_path); + + if (!newhunk) + return NULL; + git_oid_cpy(&newhunk->orig_commit_id, &hunk->orig_commit_id); git_oid_cpy(&newhunk->final_commit_id, &hunk->final_commit_id); newhunk->boundary = hunk->boundary; @@ -221,6 +225,10 @@ new_line_count = hunk->lines_in_hunk - rel_line; nh = new_hunk((uint16_t)(hunk->final_start_line_number+rel_line), (uint16_t)new_line_count, (uint16_t)(hunk->orig_start_line_number+rel_line), hunk->orig_path); + + if (!nh) + return NULL; + git_oid_cpy(&nh->final_commit_id, &hunk->final_commit_id); git_oid_cpy(&nh->orig_commit_id, &hunk->orig_commit_id); @@ -270,6 +278,10 @@ { git_blame_hunk *h = new_hunk( e->lno+1, e->num_lines, e->s_lno+1, e->suspect->path); + + if (!h) + return NULL; + git_oid_cpy(&h->final_commit_id, git_commit_id(e->suspect->commit)); git_oid_cpy(&h->orig_commit_id, git_commit_id(e->suspect->commit)); git_signature_dup(&h->final_signature, git_commit_author(e->suspect->commit)); @@ -307,6 +319,8 @@ blame->final_buf_size = git_blob_rawsize(blame->final_blob); ent = git__calloc(1, sizeof(git_blame__entry)); + GITERR_CHECK_ALLOC(ent); + ent->num_lines = index_blob_lines(blame); ent->lno = blame->options.min_line - 1; ent->num_lines = ent->num_lines - blame->options.min_line + 1; @@ -322,8 +336,9 @@ cleanup: for (ent = blame->ent; ent; ) { git_blame__entry *e = ent->next; + git_blame_hunk *h = hunk_from_entry(ent); - git_vector_insert(&blame->hunks, hunk_from_entry(ent)); + git_vector_insert(&blame->hunks, h); git_blame__free_entry(ent); ent = e; @@ -392,11 +407,14 @@ if (!blame->current_hunk) { /* Line added at the end of the file */ blame->current_hunk = new_hunk(wedge_line, 0, wedge_line, blame->path); + GITERR_CHECK_ALLOC(blame->current_hunk); + git_vector_insert(&blame->hunks, blame->current_hunk); } else if (!hunk_starts_at_or_after_line(blame->current_hunk, wedge_line)){ /* If this hunk doesn't start between existing hunks, split a hunk up so it does */ blame->current_hunk = split_hunk_in_vector(&blame->hunks, blame->current_hunk, wedge_line - blame->current_hunk->orig_start_line_number, true); + GITERR_CHECK_ALLOC(blame->current_hunk); } return 0; @@ -425,6 +443,8 @@ /* Create a new buffer-blame hunk with this line */ shift_hunks_by(&blame->hunks, blame->current_diff_line, 1); blame->current_hunk = new_hunk((uint16_t)blame->current_diff_line, 1, 0, blame->path); + GITERR_CHECK_ALLOC(blame->current_hunk); + git_vector_insert_sorted(&blame->hunks, blame->current_hunk, NULL); } blame->current_diff_line++; @@ -464,16 +484,20 @@ assert(out && reference && buffer && buffer_len); blame = git_blame__alloc(reference->repository, reference->options, reference->path); + GITERR_CHECK_ALLOC(blame); /* Duplicate all of the hunk structures in the reference blame */ git_vector_foreach(&reference->hunks, i, hunk) { - git_vector_insert(&blame->hunks, dup_hunk(hunk)); + git_blame_hunk *h = dup_hunk(hunk); + GITERR_CHECK_ALLOC(h); + + git_vector_insert(&blame->hunks, h); } /* Diff to the reference blob */ git_diff_blob_to_buffer(reference->final_blob, blame->path, - buffer, buffer_len, blame->path, - &diffopts, NULL, buffer_hunk_cb, buffer_line_cb, blame); + buffer, buffer_len, blame->path, &diffopts, + NULL, NULL, buffer_hunk_cb, buffer_line_cb, blame); *out = blame; return 0; diff -Nru libgit2-0.22.2/src/blame_git.c libgit2-0.23.1/src/blame_git.c --- libgit2-0.22.2/src/blame_git.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/blame_git.c 2015-08-03 18:07:35.000000000 +0000 @@ -35,11 +35,15 @@ /* Given a commit and a path in it, create a new origin structure. */ static int make_origin(git_blame__origin **out, git_commit *commit, const char *path) { - int error = 0; git_blame__origin *o; + size_t path_len = strlen(path), alloc_len; + int error = 0; - o = git__calloc(1, sizeof(*o) + strlen(path) + 1); + GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*o), path_len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 1); + o = git__calloc(1, alloc_len); GITERR_CHECK_ALLOC(o); + o->commit = commit; o->refcnt = 1; strcpy(o->path, path); @@ -300,21 +304,16 @@ } static int my_emit( - xdfenv_t *xe, - xdchange_t *xscr, - xdemitcb_t *ecb, - xdemitconf_t const *xecfg) -{ - xdchange_t *xch = xscr; - GIT_UNUSED(xe); - GIT_UNUSED(xecfg); - while (xch) { - blame_chunk_cb_data *d = ecb->priv; - blame_chunk(d->blame, d->tlno, d->plno, xch->i2, d->target, d->parent); - d->plno = xch->i1 + xch->chg1; - d->tlno = xch->i2 + xch->chg2; - xch = xch->next; - } + long start_a, long count_a, + long start_b, long count_b, + void *cb_data) +{ + blame_chunk_cb_data *d = (blame_chunk_cb_data *)cb_data; + + blame_chunk(d->blame, d->tlno, d->plno, start_b, d->target, d->parent); + d->plno = start_a + count_a; + d->tlno = start_b + count_b; + return 0; } @@ -348,7 +347,7 @@ xdemitconf_t xecfg = {0}; xdemitcb_t ecb = {0}; - xecfg.emit_func = (void(*)(void))my_emit; + xecfg.hunk_func = my_emit; ecb.priv = cb_data; trim_common_tail(&file_a, &file_b, 0); diff -Nru libgit2-0.22.2/src/blob.c libgit2-0.23.1/src/blob.c --- libgit2-0.22.2/src/blob.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/blob.c 2015-08-03 18:07:35.000000000 +0000 @@ -74,12 +74,13 @@ git_oid *id, git_odb *odb, const char *path, git_off_t file_size) { int fd, error; - char buffer[4096]; + char buffer[FILEIO_BUFSIZE]; git_odb_stream *stream = NULL; - ssize_t read_len = -1, written = 0; + ssize_t read_len = -1; + git_off_t written = 0; if ((error = git_odb_open_wstream( - &stream, odb, (size_t)file_size, GIT_OBJ_BLOB)) < 0) + &stream, odb, file_size, GIT_OBJ_BLOB)) < 0) return error; if ((fd = git_futils_open_ro(path)) < 0) { @@ -184,6 +185,12 @@ (error = git_repository_odb(&odb, repo)) < 0) goto done; + if (S_ISDIR(st.st_mode)) { + giterr_set(GITERR_ODB, "cannot create blob from '%s'; it is a directory", content_path); + error = GIT_EDIRECTORY; + goto done; + } + if (out_st) memcpy(out_st, &st, sizeof(st)); @@ -199,7 +206,7 @@ /* Load the filters for writing this file to the ODB */ error = git_filter_list_load( &fl, repo, NULL, hint_path, - GIT_FILTER_TO_ODB, GIT_FILTER_OPT_DEFAULT); + GIT_FILTER_TO_ODB, GIT_FILTER_DEFAULT); if (error < 0) /* well, that didn't work */; @@ -329,15 +336,13 @@ int git_blob_is_binary(const git_blob *blob) { - git_buf content; + git_buf content = GIT_BUF_INIT; assert(blob); - content.ptr = blob->odb_object->buffer; - content.size = - min(blob->odb_object->cached.size, GIT_FILTER_BYTES_TO_CHECK_NUL); - content.asize = 0; - + git_buf_attach_notowned(&content, blob->odb_object->buffer, + min(blob->odb_object->cached.size, + GIT_FILTER_BYTES_TO_CHECK_NUL)); return git_buf_text_is_binary(&content); } @@ -359,7 +364,7 @@ if (!(error = git_filter_list_load( &fl, git_blob_owner(blob), blob, path, - GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT))) { + GIT_FILTER_TO_WORKTREE, GIT_FILTER_DEFAULT))) { error = git_filter_list_apply_to_blob(out, fl, blob); diff -Nru libgit2-0.22.2/src/branch.c libgit2-0.23.1/src/branch.c --- libgit2-0.22.2/src/branch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/branch.c 2015-08-03 18:07:35.000000000 +0000 @@ -12,6 +12,7 @@ #include "refspec.h" #include "refs.h" #include "remote.h" +#include "annotated_commit.h" #include "git2/branch.h" @@ -49,19 +50,18 @@ return -1; } -int git_branch_create( +static int create_branch( git_reference **ref_out, git_repository *repository, const char *branch_name, const git_commit *commit, - int force, - const git_signature *signature, - const char *log_message) + const char *from, + int force) { int is_head = 0; git_reference *branch = NULL; git_buf canonical_branch_name = GIT_BUF_INIT, - log_message_buf = GIT_BUF_INIT; + log_message = GIT_BUF_INIT; int error = -1; assert(branch_name && commit && ref_out); @@ -84,26 +84,46 @@ error = -1; goto cleanup; } - + if (git_buf_joinpath(&canonical_branch_name, GIT_REFS_HEADS_DIR, branch_name) < 0) goto cleanup; - if (git_buf_sets(&log_message_buf, log_message ? log_message : "Branch: created") < 0) + if (git_buf_printf(&log_message, "branch: Created from %s", from) < 0) goto cleanup; error = git_reference_create(&branch, repository, - git_buf_cstr(&canonical_branch_name), git_commit_id(commit), force, signature, - git_buf_cstr(&log_message_buf)); + git_buf_cstr(&canonical_branch_name), git_commit_id(commit), force, + git_buf_cstr(&log_message)); if (!error) *ref_out = branch; cleanup: git_buf_free(&canonical_branch_name); - git_buf_free(&log_message_buf); + git_buf_free(&log_message); return error; } +int git_branch_create( + git_reference **ref_out, + git_repository *repository, + const char *branch_name, + const git_commit *commit, + int force) +{ + return create_branch(ref_out, repository, branch_name, commit, git_oid_tostr_s(git_commit_id(commit)), force); +} + +int git_branch_create_from_annotated( + git_reference **ref_out, + git_repository *repository, + const char *branch_name, + const git_annotated_commit *commit, + int force) +{ + return create_branch(ref_out, repository, branch_name, commit->commit, commit->ref_name, force); +} + int git_branch_delete(git_reference *branch) { int is_head; @@ -222,14 +242,12 @@ git_reference **out, git_reference *branch, const char *new_branch_name, - int force, - const git_signature *signature, - const char *log_message) + int force) { git_buf new_reference_name = GIT_BUF_INIT, old_config_section = GIT_BUF_INIT, new_config_section = GIT_BUF_INIT, - log_message_buf = GIT_BUF_INIT; + log_message = GIT_BUF_INIT; int error; assert(branch && new_branch_name); @@ -240,20 +258,15 @@ if ((error = git_buf_joinpath(&new_reference_name, GIT_REFS_HEADS_DIR, new_branch_name)) < 0) goto done; - if (log_message) { - if ((error = git_buf_sets(&log_message_buf, log_message)) < 0) + if ((error = git_buf_printf(&log_message, "branch: renamed %s to %s", + git_reference_name(branch), git_buf_cstr(&new_reference_name))) < 0) goto done; - } else { - if ((error = git_buf_printf(&log_message_buf, "Branch: renamed %s to %s", - git_reference_name(branch), git_buf_cstr(&new_reference_name))) < 0) - goto done; - } /* first update ref then config so failure won't trash config */ error = git_reference_rename( out, branch, git_buf_cstr(&new_reference_name), force, - signature, git_buf_cstr(&log_message_buf)); + git_buf_cstr(&log_message)); if (error < 0) goto done; @@ -270,7 +283,7 @@ git_buf_free(&new_reference_name); git_buf_free(&old_config_section); git_buf_free(&new_config_section); - git_buf_free(&log_message_buf); + git_buf_free(&log_message); return error; } @@ -310,7 +323,7 @@ } static int retrieve_upstream_configuration( - const char **out, + git_buf *out, const git_config *config, const char *canonical_branch_name, const char *format) @@ -322,7 +335,7 @@ canonical_branch_name + strlen(GIT_REFS_HEADS_DIR)) < 0) return -1; - error = git_config_get_string(out, config, git_buf_cstr(&buf)); + error = git_config_get_string_buf(out, config, git_buf_cstr(&buf)); git_buf_free(&buf); return error; } @@ -332,7 +345,8 @@ git_repository *repo, const char *refname) { - const char *remote_name, *merge_name; + git_buf remote_name = GIT_BUF_INIT; + git_buf merge_name = GIT_BUF_INIT; git_buf buf = GIT_BUF_INIT; int error = -1; git_remote *remote = NULL; @@ -357,27 +371,27 @@ &merge_name, config, refname, "branch.%s.merge")) < 0) goto cleanup; - if (!*remote_name || !*merge_name) { + if (git_buf_len(&remote_name) == 0 || git_buf_len(&merge_name) == 0) { giterr_set(GITERR_REFERENCE, "branch '%s' does not have an upstream", refname); error = GIT_ENOTFOUND; goto cleanup; } - if (strcmp(".", remote_name) != 0) { - if ((error = git_remote_lookup(&remote, repo, remote_name)) < 0) + if (strcmp(".", git_buf_cstr(&remote_name)) != 0) { + if ((error = git_remote_lookup(&remote, repo, git_buf_cstr(&remote_name))) < 0) goto cleanup; - refspec = git_remote__matching_refspec(remote, merge_name); + refspec = git_remote__matching_refspec(remote, git_buf_cstr(&merge_name)); if (!refspec) { error = GIT_ENOTFOUND; goto cleanup; } - if (git_refspec_transform(&buf, refspec, merge_name) < 0) + if (git_refspec_transform(&buf, refspec, git_buf_cstr(&merge_name)) < 0) goto cleanup; } else - if (git_buf_sets(&buf, merge_name) < 0) + if (git_buf_set(&buf, git_buf_cstr(&merge_name), git_buf_len(&merge_name)) < 0) goto cleanup; error = git_buf_set(out, git_buf_cstr(&buf), git_buf_len(&buf)); @@ -385,6 +399,8 @@ cleanup: git_config_free(config); git_remote_free(remote); + git_buf_free(&remote_name); + git_buf_free(&merge_name); git_buf_free(&buf); return error; } @@ -392,29 +408,25 @@ int git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *refname) { int error; - const char *str; git_config *cfg; if (!git_reference__is_branch(refname)) return not_a_local_branch(refname); - git_buf_sanitize(buf); - if ((error = git_repository_config_snapshot(&cfg, repo)) < 0) + if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) return error; - if ((error = retrieve_upstream_configuration(&str, cfg, refname, "branch.%s.remote")) < 0) - goto cleanup; + git_buf_sanitize(buf); + + if ((error = retrieve_upstream_configuration(buf, cfg, refname, "branch.%s.remote")) < 0) + return error; - if (!*str) { + if (git_buf_len(buf) == 0) { giterr_set(GITERR_REFERENCE, "branch '%s' does not have an upstream remote", refname); error = GIT_ENOTFOUND; - goto cleanup; + git_buf_clear(buf); } - error = git_buf_puts(buf, str); - -cleanup: - git_config_free(cfg); return error; } @@ -539,7 +551,7 @@ git_remote *remote = NULL; git_config *config; const char *name, *shortname; - int local; + int local, error; const git_refspec *fetchspec; name = git_reference_name(branch); @@ -574,9 +586,12 @@ * that. */ if (local) - git_buf_puts(&value, "."); + error = git_buf_puts(&value, "."); else - git_branch_remote_name(&value, repo, git_reference_name(upstream)); + error = git_branch_remote_name(&value, repo, git_reference_name(upstream)); + + if (error < 0) + goto on_error; if (git_buf_printf(&key, "branch.%s.remote", shortname) < 0) goto on_error; diff -Nru libgit2-0.22.2/src/bswap.h libgit2-0.23.1/src/bswap.h --- libgit2-0.22.2/src/bswap.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/bswap.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,97 +0,0 @@ -/* - * Copyright (C) the libgit2 contributors. All rights reserved. - * - * This file is part of libgit2, distributed under the GNU GPL v2 with - * a Linking Exception. For full terms see the included COPYING file. - */ - -#include "common.h" - -/* - * Default version that the compiler ought to optimize properly with - * constant values. - */ -GIT_INLINE(uint32_t) default_swab32(uint32_t val) -{ - return (((val & 0xff000000) >> 24) | - ((val & 0x00ff0000) >> 8) | - ((val & 0x0000ff00) << 8) | - ((val & 0x000000ff) << 24)); -} - -#undef bswap32 - -GIT_INLINE(uint16_t) default_swab16(uint16_t val) -{ - return (((val & 0xff00) >> 8) | - ((val & 0x00ff) << 8)); -} - -#undef bswap16 - -#if defined(__GNUC__) && defined(__i386__) - -#define bswap32(x) ({ \ - uint32_t __res; \ - if (__builtin_constant_p(x)) { \ - __res = default_swab32(x); \ - } else { \ - __asm__("bswap %0" : "=r" (__res) : "0" ((uint32_t)(x))); \ - } \ - __res; }) - -#define bswap16(x) ({ \ - uint16_t __res; \ - if (__builtin_constant_p(x)) { \ - __res = default_swab16(x); \ - } else { \ - __asm__("xchgb %b0,%h0" : "=q" (__res) : "0" ((uint16_t)(x))); \ - } \ - __res; }) - -#elif defined(__GNUC__) && defined(__x86_64__) - -#define bswap32(x) ({ \ - uint32_t __res; \ - if (__builtin_constant_p(x)) { \ - __res = default_swab32(x); \ - } else { \ - __asm__("bswapl %0" : "=r" (__res) : "0" ((uint32_t)(x))); \ - } \ - __res; }) - -#define bswap16(x) ({ \ - uint16_t __res; \ - if (__builtin_constant_p(x)) { \ - __res = default_swab16(x); \ - } else { \ - __asm__("xchgb %b0,%h0" : "=Q" (__res) : "0" ((uint16_t)(x))); \ - } \ - __res; }) - -#elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) - -#include - -#define bswap32(x) _byteswap_ulong(x) -#define bswap16(x) _byteswap_ushort(x) - -#endif - -#ifdef bswap32 - -#undef ntohl -#undef htonl -#define ntohl(x) bswap32(x) -#define htonl(x) bswap32(x) - -#endif - -#ifdef bswap16 - -#undef ntohs -#undef htons -#define ntohs(x) bswap16(x) -#define htons(x) bswap16(x) - -#endif diff -Nru libgit2-0.22.2/src/buffer.c libgit2-0.23.1/src/buffer.c --- libgit2-0.22.2/src/buffer.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/buffer.c 2015-08-03 18:07:35.000000000 +0000 @@ -33,7 +33,7 @@ } int git_buf_try_grow( - git_buf *buf, size_t target_size, bool mark_oom, bool preserve_external) + git_buf *buf, size_t target_size, bool mark_oom) { char *new_ptr; size_t new_size; @@ -41,6 +41,11 @@ if (buf->ptr == git_buf__oom) return -1; + if (buf->asize == 0 && buf->size != 0) { + giterr_set(GITERR_INVALID, "cannot grow a borrowed buffer"); + return GIT_EINVALID; + } + if (!target_size) target_size = buf->size; @@ -63,6 +68,14 @@ /* round allocation up to multiple of 8 */ new_size = (new_size + 7) & ~7; + if (new_size < buf->size) { + if (mark_oom) + buf->ptr = git_buf__oom; + + giterr_set_oom(); + return -1; + } + new_ptr = git__realloc(new_ptr, new_size); if (!new_ptr) { @@ -74,9 +87,6 @@ return -1; } - if (preserve_external && !buf->asize && buf->ptr != NULL && buf->size > 0) - memcpy(new_ptr, buf->ptr, min(buf->size, new_size)); - buf->asize = new_size; buf->ptr = new_ptr; @@ -90,7 +100,19 @@ int git_buf_grow(git_buf *buffer, size_t target_size) { - return git_buf_try_grow(buffer, target_size, true, true); + return git_buf_try_grow(buffer, target_size, true); +} + +int git_buf_grow_by(git_buf *buffer, size_t additional_size) +{ + size_t newsize; + + if (GIT_ADD_SIZET_OVERFLOW(&newsize, buffer->size, additional_size)) { + buffer->ptr = git_buf__oom; + return -1; + } + + return git_buf_try_grow(buffer, newsize, true); } void git_buf_free(git_buf *buf) @@ -127,11 +149,14 @@ int git_buf_set(git_buf *buf, const void *data, size_t len) { + size_t alloclen; + if (len == 0 || data == NULL) { git_buf_clear(buf); } else { if (data != buf->ptr) { - ENSURE_SIZE(buf, len + 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1); + ENSURE_SIZE(buf, alloclen); memmove(buf->ptr, data, len); } @@ -160,7 +185,9 @@ int git_buf_putc(git_buf *buf, char c) { - ENSURE_SIZE(buf, buf->size + 2); + size_t new_size; + GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, 2); + ENSURE_SIZE(buf, new_size); buf->ptr[buf->size++] = c; buf->ptr[buf->size] = '\0'; return 0; @@ -168,7 +195,10 @@ int git_buf_putcn(git_buf *buf, char c, size_t len) { - ENSURE_SIZE(buf, buf->size + len + 1); + size_t new_size; + GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len); + GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1); + ENSURE_SIZE(buf, new_size); memset(buf->ptr + buf->size, c, len); buf->size += len; buf->ptr[buf->size] = '\0'; @@ -178,8 +208,13 @@ int git_buf_put(git_buf *buf, const char *data, size_t len) { if (len) { + size_t new_size; + assert(data); - ENSURE_SIZE(buf, buf->size + len + 1); + + GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len); + GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1); + ENSURE_SIZE(buf, new_size); memmove(buf->ptr + buf->size, data, len); buf->size += len; buf->ptr[buf->size] = '\0'; @@ -201,8 +236,13 @@ size_t extra = len % 3; uint8_t *write, a, b, c; const uint8_t *read = (const uint8_t *)data; + size_t blocks = (len / 3) + !!extra, alloclen; + + GITERR_CHECK_ALLOC_ADD(&blocks, blocks, 1); + GITERR_CHECK_ALLOC_MULTIPLY(&alloclen, blocks, 4); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, buf->size); - ENSURE_SIZE(buf, buf->size + 4 * ((len / 3) + !!extra) + 1); + ENSURE_SIZE(buf, alloclen); write = (uint8_t *)&buf->ptr[buf->size]; /* convert each run of 3 bytes into 4 output bytes */ @@ -253,10 +293,12 @@ { size_t i; int8_t a, b, c, d; - size_t orig_size = buf->size; + size_t orig_size = buf->size, new_size; assert(len % 4 == 0); - ENSURE_SIZE(buf, buf->size + (len / 4 * 3) + 1); + GITERR_CHECK_ALLOC_ADD(&new_size, (len / 4 * 3), buf->size); + GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1); + ENSURE_SIZE(buf, new_size); for (i = 0; i < len; i += 4) { if ((a = BASE64_DECODE_VALUE(base64[i])) < 0 || @@ -284,7 +326,13 @@ int git_buf_encode_base85(git_buf *buf, const char *data, size_t len) { - ENSURE_SIZE(buf, buf->size + (5 * ((len / 4) + !!(len % 4))) + 1); + size_t blocks = (len / 4) + !!(len % 4), alloclen; + + GITERR_CHECK_ALLOC_MULTIPLY(&alloclen, blocks, 5); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, buf->size); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + + ENSURE_SIZE(buf, alloclen); while (len) { uint32_t acc = 0; @@ -317,9 +365,11 @@ int git_buf_vprintf(git_buf *buf, const char *format, va_list ap) { + size_t expected_size, new_size; int len; - const size_t expected_size = buf->size + (strlen(format) * 2); + GITERR_CHECK_ALLOC_MULTIPLY(&expected_size, strlen(format), 2); + GITERR_CHECK_ALLOC_ADD(&expected_size, expected_size, buf->size); ENSURE_SIZE(buf, expected_size); while (1) { @@ -345,7 +395,9 @@ break; } - ENSURE_SIZE(buf, buf->size + len + 1); + GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, len); + GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1); + ENSURE_SIZE(buf, new_size); } return 0; @@ -450,6 +502,20 @@ } } +void git_buf_attach_notowned(git_buf *buf, const char *ptr, size_t size) +{ + if (git_buf_is_allocated(buf)) + git_buf_free(buf); + + if (!size) { + git_buf_init(buf, 0); + } else { + buf->ptr = (char *)ptr; + buf->asize = 0; + buf->size = size; + } +} + int git_buf_join_n(git_buf *buf, char separator, int nbuf, ...) { va_list ap; @@ -472,16 +538,20 @@ continue; segment_len = strlen(segment); - total_size += segment_len; + + GITERR_CHECK_ALLOC_ADD(&total_size, total_size, segment_len); + if (segment_len == 0 || segment[segment_len - 1] != separator) - ++total_size; /* space for separator */ + GITERR_CHECK_ALLOC_ADD(&total_size, total_size, 1); } va_end(ap); /* expand buffer if needed */ if (total_size == 0) return 0; - if (git_buf_grow(buf, buf->size + total_size + 1) < 0) + + GITERR_CHECK_ALLOC_ADD(&total_size, total_size, 1); + if (git_buf_grow_by(buf, total_size) < 0) return -1; out = buf->ptr + buf->size; @@ -542,6 +612,7 @@ { size_t strlen_a = str_a ? strlen(str_a) : 0; size_t strlen_b = strlen(str_b); + size_t alloc_len; int need_sep = 0; ssize_t offset_a = -1; @@ -559,7 +630,10 @@ if (str_a >= buf->ptr && str_a < buf->ptr + buf->size) offset_a = str_a - buf->ptr; - if (git_buf_grow(buf, strlen_a + strlen_b + need_sep + 1) < 0) + GITERR_CHECK_ALLOC_ADD(&alloc_len, strlen_a, strlen_b); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, need_sep); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 1); + if (git_buf_grow(buf, alloc_len) < 0) return -1; assert(buf->ptr); @@ -587,7 +661,10 @@ const char *str_b, const char *str_c) { - size_t len_a = strlen(str_a), len_b = strlen(str_b), len_c = strlen(str_c); + size_t len_a = strlen(str_a), + len_b = strlen(str_b), + len_c = strlen(str_c), + len_total; int sep_a = 0, sep_b = 0; char *tgt; @@ -607,7 +684,12 @@ sep_b = (str_b[len_b - 1] != separator); } - if (git_buf_grow(buf, len_a + sep_a + len_b + sep_b + len_c + 1) < 0) + GITERR_CHECK_ALLOC_ADD(&len_total, len_a, sep_a); + GITERR_CHECK_ALLOC_ADD(&len_total, len_total, len_b); + GITERR_CHECK_ALLOC_ADD(&len_total, len_total, sep_b); + GITERR_CHECK_ALLOC_ADD(&len_total, len_total, len_c); + GITERR_CHECK_ALLOC_ADD(&len_total, len_total, 1); + if (git_buf_grow(buf, len_total) < 0) return -1; tgt = buf->ptr; @@ -660,22 +742,27 @@ const char *data, size_t nb_to_insert) { - assert(buf && - where <= git_buf_len(buf) && - where + nb_to_remove <= git_buf_len(buf)); + char *splice_loc; + size_t new_size, alloc_size; + + assert(buf && where <= buf->size && nb_to_remove <= buf->size - where); + + splice_loc = buf->ptr + where; /* Ported from git.git * https://github.com/git/git/blob/16eed7c/strbuf.c#L159-176 */ - ENSURE_SIZE(buf, buf->size + nb_to_insert - nb_to_insert + 1); + GITERR_CHECK_ALLOC_ADD(&new_size, (buf->size - nb_to_remove), nb_to_insert); + GITERR_CHECK_ALLOC_ADD(&alloc_size, new_size, 1); + ENSURE_SIZE(buf, alloc_size); - memmove(buf->ptr + where + nb_to_insert, - buf->ptr + where + nb_to_remove, - buf->size - where - nb_to_remove); + memmove(splice_loc + nb_to_insert, + splice_loc + nb_to_remove, + buf->size - where - nb_to_remove); - memcpy(buf->ptr + where, data, nb_to_insert); + memcpy(splice_loc, data, nb_to_insert); - buf->size = buf->size + nb_to_insert - nb_to_remove; + buf->size = new_size; buf->ptr[buf->size] = '\0'; return 0; } diff -Nru libgit2-0.22.2/src/buffer.h libgit2-0.23.1/src/buffer.h --- libgit2-0.22.2/src/buffer.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/buffer.h 2015-08-03 18:07:35.000000000 +0000 @@ -37,6 +37,18 @@ extern void git_buf_init(git_buf *buf, size_t initial_size); /** + * Resize the buffer allocation to make more space. + * + * This will attempt to grow the buffer to accommodate the additional size. + * It is similar to `git_buf_grow`, but performs the new size calculation, + * checking for overflow. + * + * Like `git_buf_grow`, if this is a user-supplied buffer, this will allocate + * a new buffer. + */ +extern int git_buf_grow_by(git_buf *buffer, size_t additional_size); + +/** * Attempt to grow the buffer to hold at least `target_size` bytes. * * If the allocation fails, this will return an error. If `mark_oom` is true, @@ -47,7 +59,7 @@ * into the newly allocated buffer. */ extern int git_buf_try_grow( - git_buf *buf, size_t target_size, bool mark_oom, bool preserve_external); + git_buf *buf, size_t target_size, bool mark_oom); /** * Sanitizes git_buf structures provided from user input. Users of the @@ -62,6 +74,12 @@ extern char *git_buf_detach(git_buf *buf); extern void git_buf_attach(git_buf *buf, char *ptr, size_t asize); +/* Populates a `git_buf` where the contents are not "owned" by the + * buffer, and calls to `git_buf_free` will not free the given buf. + */ +extern void git_buf_attach_notowned( + git_buf *buf, const char *ptr, size_t size); + /** * Test if there have been any reallocation failures with this git_buf. * diff -Nru libgit2-0.22.2/src/buf_text.c libgit2-0.23.1/src/buf_text.c --- libgit2-0.22.2/src/buf_text.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/buf_text.c 2015-08-03 18:07:35.000000000 +0000 @@ -13,7 +13,7 @@ const char *esc_with) { const char *scan; - size_t total = 0, esc_len = strlen(esc_with), count; + size_t total = 0, esc_len = strlen(esc_with), count, alloclen; if (!string) return 0; @@ -29,7 +29,8 @@ scan += count; } - if (git_buf_grow(buf, buf->size + total + 1) < 0) + GITERR_CHECK_ALLOC_ADD(&alloclen, total, 1); + if (git_buf_grow_by(buf, alloclen) < 0) return -1; for (scan = string; *scan; ) { @@ -65,6 +66,7 @@ const char *scan = src->ptr; const char *scan_end = src->ptr + src->size; const char *next = memchr(scan, '\r', src->size); + size_t new_size; char *out; assert(tgt != src); @@ -73,8 +75,10 @@ return git_buf_set(tgt, src->ptr, src->size); /* reduce reallocs while in the loop */ - if (git_buf_grow(tgt, src->size + 1) < 0) + GITERR_CHECK_ALLOC_ADD(&new_size, src->size, 1); + if (git_buf_grow(tgt, new_size) < 0) return -1; + out = tgt->ptr; tgt->size = 0; @@ -110,6 +114,7 @@ const char *end = start + src->size; const char *scan = start; const char *next = memchr(scan, '\n', src->size); + size_t alloclen; assert(tgt != src); @@ -117,24 +122,24 @@ return git_buf_set(tgt, src->ptr, src->size); /* attempt to reduce reallocs while in the loop */ - if (git_buf_grow(tgt, src->size + (src->size >> 4) + 1) < 0) + GITERR_CHECK_ALLOC_ADD(&alloclen, src->size, src->size >> 4); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + if (git_buf_grow(tgt, alloclen) < 0) return -1; tgt->size = 0; for (; next; scan = next + 1, next = memchr(scan, '\n', end - scan)) { size_t copylen = next - scan; - size_t needsize = tgt->size + copylen + 2 + 1; - /* if we find mixed line endings, bail */ - if (next > start && next[-1] == '\r') { - git_buf_free(tgt); - return GIT_PASSTHROUGH; - } + /* if we find mixed line endings, carry on */ + if (copylen && next[-1] == '\r') + copylen--; - if (tgt->asize < needsize && git_buf_grow(tgt, needsize) < 0) + GITERR_CHECK_ALLOC_ADD(&alloclen, copylen, 3); + if (git_buf_grow_by(tgt, alloclen) < 0) return -1; - if (next > scan) { + if (copylen) { memcpy(tgt->ptr + tgt->size, scan, copylen); tgt->size += copylen; } diff -Nru libgit2-0.22.2/src/buf_text.h libgit2-0.23.1/src/buf_text.h --- libgit2-0.22.2/src/buf_text.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/buf_text.h 2015-08-03 18:07:35.000000000 +0000 @@ -58,8 +58,7 @@ /** * Replace all \r\n with \n. * - * @return 0 on success, -1 on memory error, GIT_PASSTHROUGH if the - * source buffer has mixed line endings. + * @return 0 on success, -1 on memory error */ extern int git_buf_text_crlf_to_lf(git_buf *tgt, const git_buf *src); diff -Nru libgit2-0.22.2/src/cache.c libgit2-0.23.1/src/cache.c --- libgit2-0.22.2/src/cache.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/cache.c 2015-08-03 18:07:35.000000000 +0000 @@ -50,16 +50,16 @@ if (kh_size(cache->map) == 0) return; - printf("Cache %p: %d items cached, %d bytes\n", - cache, kh_size(cache->map), (int)cache->used_memory); + printf("Cache %p: %d items cached, %"PRIdZ" bytes\n", + cache, kh_size(cache->map), cache->used_memory); kh_foreach_value(cache->map, object, { char oid_str[9]; - printf(" %s%c %s (%d)\n", + printf(" %s%c %s (%"PRIuZ")\n", git_object_type2string(object->type), object->flags == GIT_CACHE_STORE_PARSED ? '*' : ' ', git_oid_tostr(oid_str, sizeof(oid_str), &object->oid), - (int)object->size + object->size ); }); } @@ -68,6 +68,7 @@ { memset(cache, 0, sizeof(*cache)); cache->map = git_oidmap_alloc(); + GITERR_CHECK_ALLOC(cache->map); if (git_rwlock_init(&cache->lock)) { giterr_set(GITERR_OS, "Failed to initialize cache rwlock"); return -1; diff -Nru libgit2-0.22.2/src/checkout.c libgit2-0.23.1/src/checkout.c --- libgit2-0.22.2/src/checkout.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/checkout.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,6 +17,7 @@ #include "git2/diff.h" #include "git2/submodule.h" #include "git2/sys/index.h" +#include "git2/sys/filter.h" #include "refs.h" #include "repository.h" @@ -28,6 +29,11 @@ #include "buf_text.h" #include "merge_file.h" #include "path.h" +#include "attr.h" +#include "pool.h" +#include "strmap.h" + +GIT__USE_STRMAP /* See docs/checkout-internals.md for more information */ @@ -68,7 +74,8 @@ size_t total_steps; size_t completed_steps; git_checkout_perfdata perfdata; - git_buf last_mkdir; + git_strmap *mkdir_map; + git_attr_session attr_session; } checkout_data; typedef struct { @@ -143,6 +150,15 @@ } } +GIT_INLINE(bool) is_workdir_base_or_new( + const git_oid *workdir_id, + const git_diff_file *baseitem, + const git_diff_file *newitem) +{ + return (git_oid__cmp(&baseitem->id, workdir_id) == 0 || + git_oid__cmp(&newitem->id, workdir_id) == 0); +} + static bool checkout_is_workdir_modified( checkout_data *data, const git_diff_file *baseitem, @@ -164,7 +180,7 @@ return true; } - if (git_submodule_status(&sm_status, sm) < 0 || + if (git_submodule_status(&sm_status, data->repo, wditem->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED) < 0 || GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status)) rval = true; else if ((sm_oid = git_submodule_wd_id(sm)) == NULL) @@ -186,8 +202,7 @@ if (wditem->mtime.seconds == ie->mtime.seconds && wditem->mtime.nanoseconds == ie->mtime.nanoseconds && wditem->file_size == ie->file_size) - return (git_oid__cmp(&baseitem->id, &ie->id) != 0 && - git_oid_cmp(&newitem->id, &ie->id) != 0); + return !is_workdir_base_or_new(&ie->id, baseitem, newitem); } /* depending on where base is coming from, we may or may not know @@ -196,10 +211,13 @@ if (baseitem->size && wditem->file_size != baseitem->size) return true; - if (git_diff__oid_for_entry(&oid, data->diff, wditem, NULL) < 0) + if (git_diff__oid_for_entry(&oid, data->diff, wditem, wditem->mode, NULL) < 0) return false; - return (git_oid__cmp(&baseitem->id, &oid) != 0); + /* Allow the checkout if the workdir is not modified *or* if the checkout + * target's contents are already in the working directory. + */ + return !is_workdir_base_or_new(&oid, baseitem, newitem); } #define CHECKOUT_ACTION_IF(FLAG,YES,NO) \ @@ -248,13 +266,13 @@ error = checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, NULL); if (error) return error; - *action = CHECKOUT_ACTION_IF(SAFE_CREATE, UPDATE_BLOB, NONE); + *action = CHECKOUT_ACTION_IF(RECREATE_MISSING, UPDATE_BLOB, NONE); break; case GIT_DELTA_ADDED: /* case 2 or 28 (and 5 but not really) */ *action = CHECKOUT_ACTION_IF(SAFE, UPDATE_BLOB, NONE); break; case GIT_DELTA_MODIFIED: /* case 13 (and 35 but not really) */ - *action = CHECKOUT_ACTION_IF(SAFE_CREATE, UPDATE_BLOB, CONFLICT); + *action = CHECKOUT_ACTION_IF(RECREATE_MISSING, UPDATE_BLOB, CONFLICT); break; case GIT_DELTA_TYPECHANGE: /* case 21 (B->T) and 28 (T->B)*/ if (delta->new_file.mode == GIT_FILEMODE_TREE) @@ -402,6 +420,14 @@ return rval; } +static bool checkout_is_empty_dir(checkout_data *data, const char *path) +{ + git_buf_truncate(&data->path, data->workdir_len); + if (git_buf_puts(&data->path, path) < 0) + return false; + return git_path_is_empty_dir(data->path.ptr); +} + static int checkout_action_with_wd( int *action, checkout_data *data, @@ -519,6 +545,7 @@ checkout_notify(data, GIT_CHECKOUT_NOTIFY_DIRTY, delta, NULL)); GITERR_CHECK_ERROR( checkout_notify(data, GIT_CHECKOUT_NOTIFY_UNTRACKED, NULL, wd)); + *action = CHECKOUT_ACTION_IF(FORCE, REMOVE_AND_UPDATE, NONE); break; case GIT_DELTA_ADDED:/* case 4 (and 7 for dir) */ case GIT_DELTA_MODIFIED: /* case 20 (or 37 but not really) */ @@ -543,8 +570,6 @@ * dir and it will succeed if no children are left. */ *action = CHECKOUT_ACTION_IF(SAFE, UPDATE_BLOB, NONE); - if (*action != CHECKOUT_ACTION__NONE) - *action |= CHECKOUT_ACTION__DEFER_REMOVE; } else if (delta->new_file.mode != GIT_FILEMODE_TREE) /* For typechange to dir, dir is already created so no action */ @@ -557,6 +582,20 @@ return checkout_action_common(action, data, delta, wd); } +static int checkout_action_with_wd_dir_empty( + int *action, + checkout_data *data, + const git_diff_delta *delta) +{ + int error = checkout_action_no_wd(action, data, delta); + + /* We can always safely remove an empty directory. */ + if (error == 0 && *action != CHECKOUT_ACTION__NONE) + *action |= CHECKOUT_ACTION__REMOVE; + + return error; +} + static int checkout_action( int *action, checkout_data *data, @@ -646,7 +685,9 @@ } } - return checkout_action_with_wd_dir(action, data, delta, workdir, wd); + return checkout_is_empty_dir(data, wd->path) ? + checkout_action_with_wd_dir_empty(action, data, delta) : + checkout_action_with_wd_dir(action, data, delta, workdir, wd); } /* case 6 - wd is after delta */ @@ -1258,11 +1299,11 @@ if (counts[CHECKOUT_ACTION__CONFLICT] > 0 && (data->strategy & GIT_CHECKOUT_ALLOW_CONFLICTS) == 0) { - giterr_set(GITERR_CHECKOUT, "%d %s checkout", - (int)counts[CHECKOUT_ACTION__CONFLICT], + giterr_set(GITERR_CHECKOUT, "%"PRIuZ" %s checkout", + counts[CHECKOUT_ACTION__CONFLICT], counts[CHECKOUT_ACTION__CONFLICT] == 1 ? "conflict prevents" : "conflicts prevent"); - error = GIT_EMERGECONFLICT; + error = GIT_ECONFLICT; goto fail; } @@ -1291,25 +1332,6 @@ return error; } -static int checkout_mkdir( - checkout_data *data, - const char *path, - const char *base, - mode_t mode, - unsigned int flags) -{ - struct git_futils_mkdir_perfdata mkdir_perfdata = {0}; - - int error = git_futils_mkdir_withperf( - path, base, mode, flags, &mkdir_perfdata); - - data->perfdata.mkdir_calls += mkdir_perfdata.mkdir_calls; - data->perfdata.stat_calls += mkdir_perfdata.stat_calls; - data->perfdata.chmod_calls += mkdir_perfdata.chmod_calls; - - return error; -} - static bool should_remove_existing(checkout_data *data) { int ignorecase = 0; @@ -1325,31 +1347,43 @@ #define MKDIR_REMOVE_EXISTING \ MKDIR_NORMAL | GIT_MKDIR_REMOVE_FILES | GIT_MKDIR_REMOVE_SYMLINKS +static int checkout_mkdir( + checkout_data *data, + const char *path, + const char *base, + mode_t mode, + unsigned int flags) +{ + struct git_futils_mkdir_options mkdir_opts = {0}; + int error; + + mkdir_opts.dir_map = data->mkdir_map; + mkdir_opts.pool = &data->pool; + + error = git_futils_mkdir_ext( + path, base, mode, flags, &mkdir_opts); + + data->perfdata.mkdir_calls += mkdir_opts.perfdata.mkdir_calls; + data->perfdata.stat_calls += mkdir_opts.perfdata.stat_calls; + data->perfdata.chmod_calls += mkdir_opts.perfdata.chmod_calls; + + return error; +} + static int mkpath2file( checkout_data *data, const char *path, unsigned int mode) { - git_buf *mkdir_path = &data->tmp; struct stat st; bool remove_existing = should_remove_existing(data); + unsigned int flags = + (remove_existing ? MKDIR_REMOVE_EXISTING : MKDIR_NORMAL) | + GIT_MKDIR_SKIP_LAST; int error; - if ((error = git_buf_sets(mkdir_path, path)) < 0) + if ((error = checkout_mkdir( + data, path, data->opts.target_directory, mode, flags)) < 0) return error; - git_buf_rtruncate_at_char(mkdir_path, '/'); - - if (!data->last_mkdir.size || - data->last_mkdir.size != mkdir_path->size || - memcmp(mkdir_path->ptr, data->last_mkdir.ptr, mkdir_path->size) != 0) { - - if ((error = checkout_mkdir( - data, mkdir_path->ptr, data->opts.target_directory, mode, - remove_existing ? MKDIR_REMOVE_EXISTING : MKDIR_NORMAL)) < 0) - return error; - - git_buf_swap(&data->last_mkdir, mkdir_path); - } - if (remove_existing) { data->perfdata.stat_calls++; @@ -1372,39 +1406,37 @@ return error; } -static int buffer_to_file( - checkout_data *data, - struct stat *st, - git_buf *buf, - const char *path, - mode_t file_mode) -{ - int error; - - if ((error = mkpath2file(data, path, data->opts.dir_mode)) < 0) - return error; +struct checkout_stream { + git_writestream base; + const char *path; + int fd; + int open; +}; - if ((error = git_futils_writebuffer( - buf, path, data->opts.file_open_flags, file_mode)) < 0) - return error; +static int checkout_stream_write( + git_writestream *s, const char *buffer, size_t len) +{ + struct checkout_stream *stream = (struct checkout_stream *)s; + int ret; - if (st) { - data->perfdata.stat_calls++; + if ((ret = p_write(stream->fd, buffer, len)) < 0) + giterr_set(GITERR_OS, "Could not write to '%s'", stream->path); - if ((error = p_stat(path, st)) < 0) { - giterr_set(GITERR_OS, "Error statting '%s'", path); - return error; - } - } + return ret; +} - if (GIT_PERMS_IS_EXEC(file_mode)) { - data->perfdata.chmod_calls++; +static int checkout_stream_close(git_writestream *s) +{ + struct checkout_stream *stream = (struct checkout_stream *)s; + assert(stream && stream->open); - if ((error = p_chmod(path, file_mode)) < 0) - giterr_set(GITERR_OS, "Failed to set permissions on '%s'", path); - } + stream->open = 0; + return p_close(stream->fd); +} - return error; +static void checkout_stream_free(git_writestream *s) +{ + GIT_UNUSED(s); } static int blob_content_to_file( @@ -1412,36 +1444,83 @@ struct stat *st, git_blob *blob, const char *path, - const char * hint_path, + const char *hint_path, mode_t entry_filemode) { + int flags = data->opts.file_open_flags; mode_t file_mode = data->opts.file_mode ? data->opts.file_mode : entry_filemode; - git_buf out = GIT_BUF_INIT; + git_filter_options filter_opts = GIT_FILTER_OPTIONS_INIT; + struct checkout_stream writer; + mode_t mode; git_filter_list *fl = NULL; + int fd; int error = 0; if (hint_path == NULL) hint_path = path; - if (!data->opts.disable_filters) - error = git_filter_list_load( - &fl, git_blob_owner(blob), blob, hint_path, - GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT); + if ((error = mkpath2file(data, path, data->opts.dir_mode)) < 0) + return error; + + if (flags <= 0) + flags = O_CREAT | O_TRUNC | O_WRONLY; + if (!(mode = file_mode)) + mode = GIT_FILEMODE_BLOB; + + if ((fd = p_open(path, flags, mode)) < 0) { + giterr_set(GITERR_OS, "Could not open '%s' for writing", path); + return fd; + } + + filter_opts.attr_session = &data->attr_session; + filter_opts.temp_buf = &data->tmp; + + if (!data->opts.disable_filters && + (error = git_filter_list__load_ext( + &fl, data->repo, blob, hint_path, + GIT_FILTER_TO_WORKTREE, &filter_opts))) + return error; + + /* setup the writer */ + memset(&writer, 0, sizeof(struct checkout_stream)); + writer.base.write = checkout_stream_write; + writer.base.close = checkout_stream_close; + writer.base.free = checkout_stream_free; + writer.path = path; + writer.fd = fd; + writer.open = 1; - if (!error) - error = git_filter_list_apply_to_blob(&out, fl, blob); + error = git_filter_list_stream_blob(fl, blob, &writer.base); + + assert(writer.open == 0); git_filter_list_free(fl); - if (!error) { - error = buffer_to_file(data, st, &out, path, file_mode); - st->st_mode = entry_filemode; + if (error < 0) + return error; + + if (GIT_PERMS_IS_EXEC(mode)) { + data->perfdata.chmod_calls++; + + if ((error = p_chmod(path, mode)) < 0) { + giterr_set(GITERR_OS, "Failed to set permissions on '%s'", path); + return error; + } + } + + if (st) { + data->perfdata.stat_calls++; + + if ((error = p_stat(path, st)) < 0) { + giterr_set(GITERR_OS, "Error statting '%s'", path); + return error; + } - git_buf_free(&out); + st->st_mode = entry_filemode; } - return error; + return 0; } static int blob_content_to_link( @@ -1781,11 +1860,6 @@ git_diff_delta *delta; size_t i; - /* initial reload of submodules if .gitmodules was changed */ - if (data->reload_submodules && - (error = git_submodule_reload_all(data->repo, 1)) < 0) - return error; - git_vector_foreach(&data->diff->deltas, i, delta) { if (actions[i] & CHECKOUT_ACTION__DEFER_REMOVE) { /* this has a blocker directory that should only be removed iff @@ -1806,8 +1880,7 @@ } } - /* final reload once submodules have been updated */ - return git_submodule_reload_all(data->repo, 1); + return 0; } static int checkout_lookup_head_tree(git_tree **out, git_repository *repo) @@ -1959,6 +2032,7 @@ git_merge_file_result result = {0}; git_filebuf output = GIT_FILEBUF_INIT; git_filter_list *fl = NULL; + git_filter_options filter_opts = GIT_FILTER_OPTIONS_INIT; int error = 0; if (data->opts.checkout_strategy & GIT_CHECKOUT_CONFLICT_STYLE_DIFF3) @@ -1993,7 +2067,7 @@ if (result.path == NULL || result.mode == 0) { giterr_set(GITERR_CHECKOUT, "Could not merge contents of file"); - error = GIT_EMERGECONFLICT; + error = GIT_ECONFLICT; goto done; } @@ -2008,8 +2082,12 @@ in_data.ptr = (char *)result.ptr; in_data.size = result.len; - if ((error = git_filter_list_load(&fl, data->repo, NULL, git_buf_cstr(&path_workdir), - GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT)) < 0 || + filter_opts.attr_session = &data->attr_session; + filter_opts.temp_buf = &data->tmp; + + if ((error = git_filter_list__load_ext( + &fl, data->repo, NULL, git_buf_cstr(&path_workdir), + GIT_FILTER_TO_WORKTREE, &filter_opts)) < 0 || (error = git_filter_list_apply_to_data(&out_data, fl, &in_data)) < 0) goto done; } else { @@ -2212,12 +2290,17 @@ git__free(data->pfx); data->pfx = NULL; - git_buf_free(&data->last_mkdir); + git_strmap_free(data->mkdir_map); + git_buf_free(&data->path); git_buf_free(&data->tmp); git_index_free(data->index); data->index = NULL; + + git_strmap_free(data->mkdir_map); + + git_attr_session__free(&data->attr_session); } static int checkout_data_init( @@ -2279,7 +2362,7 @@ /* cannot checkout if unresolved conflicts exist */ if ((data->opts.checkout_strategy & GIT_CHECKOUT_FORCE) == 0 && git_index_has_conflicts(data->index)) { - error = GIT_EMERGECONFLICT; + error = GIT_ECONFLICT; giterr_set(GITERR_CHECKOUT, "unresolved conflicts exist in the index"); goto cleanup; @@ -2291,11 +2374,17 @@ } } - /* if you are forcing, definitely allow safe updates */ + /* if you are forcing, allow all safe updates, plus recreate missing */ if ((data->opts.checkout_strategy & GIT_CHECKOUT_FORCE) != 0) - data->opts.checkout_strategy |= GIT_CHECKOUT_SAFE_CREATE; - if ((data->opts.checkout_strategy & GIT_CHECKOUT_SAFE_CREATE) != 0) - data->opts.checkout_strategy |= GIT_CHECKOUT_SAFE; + data->opts.checkout_strategy |= GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING; + + /* if the repository does not actually have an index file, then this + * is an initial checkout (perhaps from clone), so we allow safe updates + */ + if (!data->index->on_disk && + (data->opts.checkout_strategy & GIT_CHECKOUT_SAFE) != 0) + data->opts.checkout_strategy |= GIT_CHECKOUT_RECREATE_MISSING; data->strategy = data->opts.checkout_strategy; @@ -2313,7 +2402,7 @@ &data->can_symlink, repo, GIT_CVAR_SYMLINKS)) < 0) goto cleanup; - if (!data->opts.baseline) { + if (!data->opts.baseline && !data->opts.baseline_index) { data->opts_free_baseline = true; error = checkout_lookup_head_tree(&data->opts.baseline, repo); @@ -2329,25 +2418,27 @@ if ((data->opts.checkout_strategy & (GIT_CHECKOUT_CONFLICT_STYLE_MERGE | GIT_CHECKOUT_CONFLICT_STYLE_DIFF3)) == 0) { - const char *conflict_style; + git_config_entry *conflict_style = NULL; git_config *cfg = NULL; if ((error = git_repository_config__weakptr(&cfg, repo)) < 0 || - (error = git_config_get_string(&conflict_style, cfg, "merge.conflictstyle")) < 0 || + (error = git_config_get_entry(&conflict_style, cfg, "merge.conflictstyle")) < 0 || error == GIT_ENOTFOUND) ; else if (error) goto cleanup; - else if (strcmp(conflict_style, "merge") == 0) + else if (strcmp(conflict_style->value, "merge") == 0) data->opts.checkout_strategy |= GIT_CHECKOUT_CONFLICT_STYLE_MERGE; - else if (strcmp(conflict_style, "diff3") == 0) + else if (strcmp(conflict_style->value, "diff3") == 0) data->opts.checkout_strategy |= GIT_CHECKOUT_CONFLICT_STYLE_DIFF3; else { giterr_set(GITERR_CHECKOUT, "unknown style '%s' given for 'merge.conflictstyle'", conflict_style); error = -1; + git_config_entry_free(conflict_style); goto cleanup; } + git_config_entry_free(conflict_style); } if ((error = git_vector_init(&data->removes, 0, git__strcmp_cb)) < 0 || @@ -2355,11 +2446,14 @@ (error = git_vector_init(&data->update_conflicts, 0, NULL)) < 0 || (error = git_pool_init(&data->pool, 1, 0)) < 0 || (error = git_buf_puts(&data->path, data->opts.target_directory)) < 0 || - (error = git_path_to_dir(&data->path)) < 0) + (error = git_path_to_dir(&data->path)) < 0 || + (error = git_strmap_alloc(&data->mkdir_map)) < 0) goto cleanup; data->workdir_len = git_buf_len(&data->path); + git_attr_session__init(&data->attr_session, data->repo); + cleanup: if (error < 0) checkout_data_clear(data); @@ -2367,6 +2461,9 @@ return error; } +#define CHECKOUT_INDEX_DONT_WRITE_MASK \ + (GIT_CHECKOUT_DONT_UPDATE_INDEX | GIT_CHECKOUT_DONT_WRITE_INDEX) + int git_checkout_iterator( git_iterator *target, git_index *index, @@ -2393,7 +2490,8 @@ GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_TYPECHANGE | GIT_DIFF_INCLUDE_TYPECHANGE_TREES | - GIT_DIFF_SKIP_BINARY_CHECK; + GIT_DIFF_SKIP_BINARY_CHECK | + GIT_DIFF_INCLUDE_CASECHANGE; if (data.opts.checkout_strategy & GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH) diff_opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; if (data.opts.paths.count > 0) @@ -2408,12 +2506,21 @@ (error = git_iterator_for_workdir_ext( &workdir, data.repo, data.opts.target_directory, index, NULL, iterflags | GIT_ITERATOR_DONT_AUTOEXPAND, - data.pfx, data.pfx)) < 0 || - (error = git_iterator_for_tree( - &baseline, data.opts.baseline, - iterflags, data.pfx, data.pfx)) < 0) + data.pfx, data.pfx)) < 0) goto cleanup; + if (data.opts.baseline_index) { + if ((error = git_iterator_for_index( + &baseline, data.opts.baseline_index, + iterflags, data.pfx, data.pfx)) < 0) + goto cleanup; + } else { + if ((error = git_iterator_for_tree( + &baseline, data.opts.baseline, + iterflags, data.pfx, data.pfx)) < 0) + goto cleanup; + } + /* Should not have case insensitivity mismatch */ assert(git_iterator_ignore_case(workdir) == git_iterator_ignore_case(baseline)); @@ -2468,9 +2575,12 @@ assert(data.completed_steps == data.total_steps); + if (data.opts.perfdata_cb) + data.opts.perfdata_cb(&data.perfdata, data.opts.perfdata_payload); + cleanup: if (!error && data.index != NULL && - (data.strategy & GIT_CHECKOUT_DONT_UPDATE_INDEX) == 0) + (data.strategy & CHECKOUT_INDEX_DONT_WRITE_MASK) == 0) error = git_index_write(data.index); git_diff_free(data.diff); @@ -2571,7 +2681,7 @@ if ((error = git_repository_index(&index, repo)) < 0) return error; - if (!(error = git_iterator_for_tree(&tree_i, tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL))) + if (!(error = git_iterator_for_tree(&tree_i, tree, 0, NULL, NULL))) error = git_checkout_iterator(tree_i, index, opts); git_iterator_free(tree_i); diff -Nru libgit2-0.22.2/src/checkout.h libgit2-0.23.1/src/checkout.h --- libgit2-0.22.2/src/checkout.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/checkout.h 2015-08-03 18:07:35.000000000 +0000 @@ -12,13 +12,6 @@ #define GIT_CHECKOUT__NOTIFY_CONFLICT_TREE (1u << 12) -/** Internal structure; this is exposed in future versions. */ -typedef struct { - size_t mkdir_calls; - size_t stat_calls; - size_t chmod_calls; -} git_checkout_perfdata; - /** * Update the working directory to match the target iterator. The * expected baseline value can be passed in via the checkout options diff -Nru libgit2-0.22.2/src/cherrypick.c libgit2-0.23.1/src/cherrypick.c --- libgit2-0.22.2/src/cherrypick.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/cherrypick.c 2015-08-03 18:07:35.000000000 +0000 @@ -10,6 +10,7 @@ #include "filebuf.h" #include "merge.h" #include "vector.h" +#include "index.h" #include "git2/types.h" #include "git2/merge.h" @@ -71,7 +72,7 @@ const char *their_label) { int error = 0; - unsigned int default_checkout_strategy = GIT_CHECKOUT_SAFE_CREATE | + unsigned int default_checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_ALLOW_CONFLICTS; GIT_UNUSED(repo); @@ -171,7 +172,8 @@ char commit_oidstr[GIT_OID_HEXSZ + 1]; const char *commit_msg, *commit_summary; git_buf their_label = GIT_BUF_INIT; - git_index *index_new = NULL; + git_index *index = NULL; + git_indexwriter indexwriter = GIT_INDEXWRITER_INIT; int error = 0; assert(repo && commit); @@ -192,21 +194,25 @@ if ((error = write_merge_msg(repo, commit_msg)) < 0 || (error = git_buf_printf(&their_label, "%.7s... %s", commit_oidstr, commit_summary)) < 0 || (error = cherrypick_normalize_opts(repo, &opts, given_opts, git_buf_cstr(&their_label))) < 0 || + (error = git_indexwriter_init_for_operation(&indexwriter, repo, &opts.checkout_opts.checkout_strategy)) < 0 || (error = write_cherrypick_head(repo, commit_oidstr)) < 0 || (error = git_repository_head(&our_ref, repo)) < 0 || (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 || - (error = git_cherrypick_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 || - (error = git_merge__check_result(repo, index_new)) < 0 || - (error = git_merge__append_conflicts_to_merge_msg(repo, index_new)) < 0 || - (error = git_checkout_index(repo, index_new, &opts.checkout_opts)) < 0) + (error = git_cherrypick_commit(&index, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 || + (error = git_merge__check_result(repo, index)) < 0 || + (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 || + (error = git_checkout_index(repo, index, &opts.checkout_opts)) < 0 || + (error = git_indexwriter_commit(&indexwriter)) < 0) goto on_error; + goto done; on_error: cherrypick_state_cleanup(repo); done: - git_index_free(index_new); + git_indexwriter_cleanup(&indexwriter); + git_index_free(index); git_commit_free(our_commit); git_reference_free(our_ref); git_buf_free(&their_label); diff -Nru libgit2-0.22.2/src/clone.c libgit2-0.23.1/src/clone.c --- libgit2-0.22.2/src/clone.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/clone.c 2015-08-03 18:07:35.000000000 +0000 @@ -24,18 +24,18 @@ #include "repository.h" #include "odb.h" -static int clone_local_into(git_repository *repo, git_remote *remote, const git_checkout_options *co_opts, const char *branch, int link, const git_signature *signature); +static int clone_local_into(git_repository *repo, git_remote *remote, const git_fetch_options *fetch_opts, const git_checkout_options *co_opts, const char *branch, int link); static int create_branch( git_reference **branch, git_repository *repo, const git_oid *target, const char *name, - const git_signature *signature, const char *log_message) { git_commit *head_obj = NULL; git_reference *branch_ref = NULL; + git_buf refname = GIT_BUF_INIT; int error; /* Find the target commit */ @@ -43,8 +43,11 @@ return error; /* Create the new branch */ - error = git_branch_create(&branch_ref, repo, name, head_obj, 0, signature, log_message); + if ((error = git_buf_printf(&refname, GIT_REFS_HEADS_DIR "%s", name)) < 0) + return error; + error = git_reference_create(&branch_ref, repo, git_buf_cstr(&refname), target, 0, log_message); + git_buf_free(&refname); git_commit_free(head_obj); if (!error) @@ -93,12 +96,11 @@ git_repository *repo, const git_oid *target, const char *branch_name, - const git_signature *signature, const char *log_message) { int error; - if ((error = create_branch(branch, repo, target, branch_name, signature, log_message)) < 0) + if ((error = create_branch(branch, repo, target, branch_name, log_message)) < 0) return error; return setup_tracking_config( @@ -112,7 +114,6 @@ git_repository *repo, const git_oid *target, const char *name, - const git_signature *signature, const char *reflog_message) { git_reference *tracking_branch = NULL; @@ -122,12 +123,11 @@ name += strlen(GIT_REFS_HEADS_DIR); error = create_tracking_branch(&tracking_branch, repo, target, name, - signature, reflog_message); + reflog_message); if (!error) error = git_repository_set_head( - repo, git_reference_name(tracking_branch), - signature, reflog_message); + repo, git_reference_name(tracking_branch)); git_reference_free(tracking_branch); @@ -141,7 +141,6 @@ static int update_head_to_remote( git_repository *repo, git_remote *remote, - const git_signature *signature, const char *reflog_message) { int error = 0; @@ -169,7 +168,7 @@ error = git_remote_default_branch(&branch, remote); if (error == GIT_ENOTFOUND) { error = git_repository_set_head_detached( - repo, remote_head_id, signature, reflog_message); + repo, remote_head_id); goto cleanup; } @@ -192,7 +191,7 @@ repo, remote_head_id, git_buf_cstr(&branch), - signature, reflog_message); + reflog_message); cleanup: git_buf_free(&remote_master_name); @@ -205,7 +204,6 @@ git_repository *repo, const char *remote_name, const char *branch, - const git_signature *signature, const char *reflog_message) { int retcode; @@ -222,7 +220,7 @@ goto cleanup; retcode = update_head_to_new_branch(repo, git_reference_target(remote_ref), branch, - signature, reflog_message); + reflog_message); cleanup: git_reference_free(remote_ref); @@ -244,13 +242,9 @@ const char *url, void *payload) { - int error; - git_remote_callbacks *callbacks = payload; - - if ((error = git_remote_create(out, repo, name, url)) < 0) - return error; + GIT_UNUSED(payload); - return git_remote_set_callbacks(*out, callbacks); + return git_remote_create(out, repo, name, url); } /* @@ -279,15 +273,12 @@ if (!remote_create) { remote_create = default_remote_create; - payload = (void *)&options->remote_callbacks; + payload = NULL; } if ((error = remote_create(&origin, repo, "origin", url, payload)) < 0) goto on_error; - if ((error = git_remote_save(origin)) < 0) - goto on_error; - *out = origin; return 0; @@ -313,16 +304,16 @@ return !git_repository_head_unborn(repo); } -static int checkout_branch(git_repository *repo, git_remote *remote, const git_checkout_options *co_opts, const char *branch, const git_signature *signature, const char *reflog_message) +static int checkout_branch(git_repository *repo, git_remote *remote, const git_checkout_options *co_opts, const char *branch, const char *reflog_message) { int error; if (branch) error = update_head_to_branch(repo, git_remote_name(remote), branch, - signature, reflog_message); + reflog_message); /* Point HEAD to the same ref as the remote's head */ else - error = update_head_to_remote(repo, remote, signature, reflog_message); + error = update_head_to_remote(repo, remote, reflog_message); if (!error && should_checkout(repo, git_repository_is_bare(repo), co_opts)) error = git_checkout_head(repo, co_opts); @@ -330,12 +321,12 @@ return error; } -static int clone_into(git_repository *repo, git_remote *_remote, const git_checkout_options *co_opts, const char *branch, const git_signature *signature) +static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch_options *opts, const git_checkout_options *co_opts, const char *branch) { int error; git_buf reflog_message = GIT_BUF_INIT; + git_fetch_options fetch_opts; git_remote *remote; - const git_remote_callbacks *callbacks; assert(repo && _remote); @@ -347,21 +338,15 @@ if ((error = git_remote_dup(&remote, _remote)) < 0) return error; - callbacks = git_remote_get_callbacks(_remote); - if (!giterr__check_version(callbacks, 1, "git_remote_callbacks") && - (error = git_remote_set_callbacks(remote, callbacks)) < 0) - goto cleanup; - - if ((error = git_remote_add_fetch(remote, "refs/tags/*:refs/tags/*")) < 0) - goto cleanup; - - git_remote_set_update_fetchhead(remote, 0); + memcpy(&fetch_opts, opts, sizeof(git_fetch_options)); + fetch_opts.update_fetchhead = 0; + fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL; git_buf_printf(&reflog_message, "clone: from %s", git_remote_url(remote)); - if ((error = git_remote_fetch(remote, NULL, signature, git_buf_cstr(&reflog_message))) != 0) + if ((error = git_remote_fetch(remote, NULL, &fetch_opts, git_buf_cstr(&reflog_message))) != 0) goto cleanup; - error = checkout_branch(repo, remote, co_opts, branch, signature, git_buf_cstr(&reflog_message)); + error = checkout_branch(repo, remote, co_opts, branch, git_buf_cstr(&reflog_message)); cleanup: git_remote_free(remote); @@ -441,12 +426,12 @@ if (clone_local == 1) error = clone_local_into( - repo, origin, &options.checkout_opts, - options.checkout_branch, link, options.signature); + repo, origin, &options.fetch_opts, &options.checkout_opts, + options.checkout_branch, link); else if (clone_local == 0) error = clone_into( - repo, origin, &options.checkout_opts, - options.checkout_branch, options.signature); + repo, origin, &options.fetch_opts, &options.checkout_opts, + options.checkout_branch); else error = -1; @@ -508,7 +493,7 @@ #endif } -static int clone_local_into(git_repository *repo, git_remote *remote, const git_checkout_options *co_opts, const char *branch, int link, const git_signature *signature) +static int clone_local_into(git_repository *repo, git_remote *remote, const git_fetch_options *fetch_opts, const git_checkout_options *co_opts, const char *branch, int link) { int error, flags; git_repository *src; @@ -547,16 +532,29 @@ if (can_link(git_repository_path(src), git_repository_path(repo), link)) flags |= GIT_CPDIR_LINK_FILES; - if ((error = git_futils_cp_r(git_buf_cstr(&src_odb), git_buf_cstr(&dst_odb), - flags, GIT_OBJECT_DIR_MODE)) < 0) + error = git_futils_cp_r(git_buf_cstr(&src_odb), git_buf_cstr(&dst_odb), + flags, GIT_OBJECT_DIR_MODE); + + /* + * can_link() doesn't catch all variations, so if we hit an + * error and did want to link, let's try again without trying + * to link. + */ + if (error < 0 && link) { + flags &= ~GIT_CPDIR_LINK_FILES; + error = git_futils_cp_r(git_buf_cstr(&src_odb), git_buf_cstr(&dst_odb), + flags, GIT_OBJECT_DIR_MODE); + } + + if (error < 0) goto cleanup; git_buf_printf(&reflog_message, "clone: from %s", git_remote_url(remote)); - if ((error = git_remote_fetch(remote, NULL, signature, git_buf_cstr(&reflog_message))) != 0) + if ((error = git_remote_fetch(remote, NULL, fetch_opts, git_buf_cstr(&reflog_message))) != 0) goto cleanup; - error = checkout_branch(repo, remote, co_opts, branch, signature, git_buf_cstr(&reflog_message)); + error = checkout_branch(repo, remote, co_opts, branch, git_buf_cstr(&reflog_message)); cleanup: git_buf_free(&reflog_message); diff -Nru libgit2-0.22.2/src/commit.c libgit2-0.23.1/src/commit.c --- libgit2-0.22.2/src/commit.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/commit.c 2015-08-03 18:07:35.000000000 +0000 @@ -104,7 +104,7 @@ if (update_ref != NULL) { error = git_reference__update_for_commit( - repo, ref, update_ref, id, committer, "commit"); + repo, ref, update_ref, id, "commit"); git_reference_free(ref); return error; } @@ -295,7 +295,7 @@ if (!error && update_ref) { error = git_reference__update_for_commit( - repo, ref, NULL, id, committer, "commit"); + repo, ref, NULL, id, "commit"); git_reference_free(ref); } @@ -309,6 +309,7 @@ const char *buffer_end = buffer_start + git_odb_object_size(odb_obj); git_oid parent_id; size_t header_len; + git_signature dummy_sig; buffer = buffer_start; @@ -337,6 +338,15 @@ if (git_signature__parse(commit->author, &buffer, buffer_end, "author ", '\n') < 0) return -1; + /* Some tools create multiple author fields, ignore the extra ones */ + while ((size_t)(buffer_end - buffer) >= strlen("author ") && !git__prefixcmp(buffer, "author ")) { + if (git_signature__parse(&dummy_sig, &buffer, buffer_end, "author ", '\n') < 0) + return -1; + + git__free(dummy_sig.name); + git__free(dummy_sig.email); + } + /* Always parse the committer; we need the commit time */ commit->committer = git__malloc(sizeof(git_signature)); GITERR_CHECK_ALLOC(commit->committer); @@ -400,7 +410,7 @@ GIT_COMMIT_GETTER(git_time_t, time, commit->committer->when.time) GIT_COMMIT_GETTER(int, time_offset, commit->committer->when.offset) GIT_COMMIT_GETTER(unsigned int, parentcount, (unsigned int)git_array_size(commit->parent_ids)) -GIT_COMMIT_GETTER(const git_oid *, tree_id, &commit->tree_id); +GIT_COMMIT_GETTER(const git_oid *, tree_id, &commit->tree_id) const char *git_commit_message(const git_commit *commit) { @@ -508,3 +518,58 @@ *ancestor = parent; return 0; } + +int git_commit_header_field(git_buf *out, const git_commit *commit, const char *field) +{ + const char *buf = commit->raw_header; + const char *h, *eol; + + git_buf_sanitize(out); + while ((h = strchr(buf, '\n')) && h[1] != '\0' && h[1] != '\n') { + h++; + if (git__prefixcmp(h, field)) { + buf = h; + continue; + } + + h += strlen(field); + eol = strchr(h, '\n'); + if (h[0] != ' ') { + buf = h; + continue; + } + if (!eol) + goto malformed; + + h++; /* skip the SP */ + + git_buf_put(out, h, eol - h); + if (git_buf_oom(out)) + goto oom; + + /* If the next line starts with SP, it's multi-line, we must continue */ + while (eol[1] == ' ') { + git_buf_putc(out, '\n'); + h = eol + 2; + eol = strchr(h, '\n'); + if (!eol) + goto malformed; + + git_buf_put(out, h, eol - h); + } + + if (git_buf_oom(out)) + goto oom; + + return 0; + } + + return GIT_ENOTFOUND; + +malformed: + giterr_set(GITERR_OBJECT, "malformed header"); + return -1; +oom: + giterr_set_oom(); + return -1; +} diff -Nru libgit2-0.22.2/src/common.h libgit2-0.23.1/src/common.h --- libgit2-0.22.2/src/common.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/common.h 2015-08-03 18:07:35.000000000 +0000 @@ -17,6 +17,11 @@ # define GIT_INLINE(type) static inline type #endif +/** Support for gcc/clang __has_builtin intrinsic */ +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif + #include #include #include @@ -59,10 +64,15 @@ #include "git2/types.h" #include "git2/errors.h" #include "thread-utils.h" -#include "bswap.h" +#include "integer.h" #include +#define DEFAULT_BUFSIZE 65536 +#define FILEIO_BUFSIZE DEFAULT_BUFSIZE +#define FILTERIO_BUFSIZE DEFAULT_BUFSIZE +#define NETIO_BUFSIZE DEFAULT_BUFSIZE + /** * Check a pointer allocation result, returning -1 if it failed. */ @@ -176,6 +186,23 @@ GITERR_CHECK_VERSION(&(VERSION), _tmpl.version, #TYPE); \ memcpy((PTR), &_tmpl, sizeof(_tmpl)); } while (0) + +/** Check for additive overflow, setting an error if would occur. */ +#define GIT_ADD_SIZET_OVERFLOW(out, one, two) \ + (git__add_sizet_overflow(out, one, two) ? (giterr_set_oom(), 1) : 0) + +/** Check for additive overflow, setting an error if would occur. */ +#define GIT_MULTIPLY_SIZET_OVERFLOW(out, nelem, elsize) \ + (git__multiply_sizet_overflow(out, nelem, elsize) ? (giterr_set_oom(), 1) : 0) + +/** Check for additive overflow, failing if it would occur. */ +#define GITERR_CHECK_ALLOC_ADD(out, one, two) \ + if (GIT_ADD_SIZET_OVERFLOW(out, one, two)) { return -1; } + +/** Check for multiplicative overflow, failing if it would occur. */ +#define GITERR_CHECK_ALLOC_MULTIPLY(out, nelem, elsize) \ + if (GIT_MULTIPLY_SIZET_OVERFLOW(out, nelem, elsize)) { return -1; } + /* NOTE: other giterr functions are in the public errors.h header file */ #include "util.h" diff -Nru libgit2-0.22.2/src/config.c libgit2-0.23.1/src/config.c --- libgit2-0.22.2/src/config.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/config.c 2015-08-03 18:07:35.000000000 +0000 @@ -19,6 +19,14 @@ #include +void git_config_entry_free(git_config_entry *entry) +{ + if (!entry) + return; + + entry->free(entry); +} + typedef struct { git_refcount rc; @@ -335,7 +343,6 @@ git_config_iterator *current; const git_config *cfg; regex_t regex; - int has_regex; size_t i; } all_iter; @@ -470,9 +477,8 @@ iter = git__calloc(1, sizeof(all_iter)); GITERR_CHECK_ALLOC(iter); - if ((result = regcomp(&iter->regex, regexp, REG_EXTENDED)) < 0) { + if ((result = regcomp(&iter->regex, regexp, REG_EXTENDED)) != 0) { giterr_set_regex(&iter->regex, result); - regfree(&iter->regex); git__free(iter); return -1; } @@ -505,7 +511,7 @@ int error = 0; if (regexp != NULL) { - if ((error = regcomp(®ex, regexp, REG_EXTENDED)) < 0) { + if ((error = regcomp(®ex, regexp, REG_EXTENDED)) != 0) { giterr_set_regex(®ex, error); regfree(®ex); return -1; @@ -638,7 +644,7 @@ bool only_if_existing) { int error = 0; - const git_config_entry *ce = NULL; + git_config_entry *ce = NULL; if ((error = git_config__lookup_entry(&ce, config, key, false)) < 0) return error; @@ -657,6 +663,7 @@ else error = git_config_set_string(config, key, value); + git_config_entry_free(ce); return error; } @@ -677,7 +684,7 @@ }; static int get_entry( - const git_config_entry **out, + git_config_entry **out, const git_config *cfg, const char *name, bool normalize_name, @@ -721,13 +728,13 @@ } int git_config_get_entry( - const git_config_entry **out, const git_config *cfg, const char *name) + git_config_entry **out, const git_config *cfg, const char *name) { return get_entry(out, cfg, name, true, GET_ALL_ERRORS); } int git_config__lookup_entry( - const git_config_entry **out, + git_config_entry **out, const git_config *cfg, const char *key, bool no_errors) @@ -743,76 +750,154 @@ const git_cvar_map *maps, size_t map_n) { - const git_config_entry *entry; + git_config_entry *entry; int ret; if ((ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS)) < 0) return ret; - return git_config_lookup_map_value(out, maps, map_n, entry->value); + ret = git_config_lookup_map_value(out, maps, map_n, entry->value); + git_config_entry_free(entry); + + return ret; } int git_config_get_int64(int64_t *out, const git_config *cfg, const char *name) { - const git_config_entry *entry; + git_config_entry *entry; int ret; if ((ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS)) < 0) return ret; - return git_config_parse_int64(out, entry->value); + ret = git_config_parse_int64(out, entry->value); + git_config_entry_free(entry); + + return ret; } int git_config_get_int32(int32_t *out, const git_config *cfg, const char *name) { - const git_config_entry *entry; + git_config_entry *entry; int ret; if ((ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS)) < 0) return ret; - return git_config_parse_int32(out, entry->value); + ret = git_config_parse_int32(out, entry->value); + git_config_entry_free(entry); + + return ret; } int git_config_get_bool(int *out, const git_config *cfg, const char *name) { - const git_config_entry *entry; + git_config_entry *entry; int ret; if ((ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS)) < 0) return ret; - return git_config_parse_bool(out, entry->value); + ret = git_config_parse_bool(out, entry->value); + git_config_entry_free(entry); + + return ret; +} + +static int is_readonly(const git_config *cfg) +{ + size_t i; + file_internal *internal; + + git_vector_foreach(&cfg->files, i, internal) { + if (!internal || !internal->file) + continue; + + if (!internal->file->readonly) + return 0; + } + + return 1; +} + +int git_config_get_path(git_buf *out, const git_config *cfg, const char *name) +{ + git_config_entry *entry; + int error; + + if ((error = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS)) < 0) + return error; + + error = git_config_parse_path(out, entry->value); + git_config_entry_free(entry); + + return error; } int git_config_get_string( const char **out, const git_config *cfg, const char *name) { - const git_config_entry *entry; - int ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS); + git_config_entry *entry; + int ret; + + if (!is_readonly(cfg)) { + giterr_set(GITERR_CONFIG, "get_string called on a live config object"); + return -1; + } + + ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS); *out = !ret ? (entry->value ? entry->value : "") : NULL; + + git_config_entry_free(entry); + return ret; } -const char *git_config__get_string_force( +int git_config_get_string_buf( + git_buf *out, const git_config *cfg, const char *name) +{ + git_config_entry *entry; + int ret; + const char *str; + + git_buf_sanitize(out); + + ret = get_entry(&entry, cfg, name, true, GET_ALL_ERRORS); + str = !ret ? (entry->value ? entry->value : "") : NULL; + + if (str) + ret = git_buf_puts(out, str); + + git_config_entry_free(entry); + + return ret; +} + +char *git_config__get_string_force( const git_config *cfg, const char *key, const char *fallback_value) { - const git_config_entry *entry; + git_config_entry *entry; + char *ret; + get_entry(&entry, cfg, key, false, GET_NO_ERRORS); - return (entry && entry->value) ? entry->value : fallback_value; + ret = (entry && entry->value) ? git__strdup(entry->value) : fallback_value ? git__strdup(fallback_value) : NULL; + git_config_entry_free(entry); + + return ret; } int git_config__get_bool_force( const git_config *cfg, const char *key, int fallback_value) { int val = fallback_value; - const git_config_entry *entry; + git_config_entry *entry; get_entry(&entry, cfg, key, false, GET_NO_ERRORS); if (entry && git_config_parse_bool(&val, entry->value) < 0) giterr_clear(); + git_config_entry_free(entry); return val; } @@ -820,13 +905,14 @@ const git_config *cfg, const char *key, int fallback_value) { int32_t val = (int32_t)fallback_value; - const git_config_entry *entry; + git_config_entry *entry; get_entry(&entry, cfg, key, false, GET_NO_ERRORS); if (entry && git_config_parse_int32(&val, entry->value) < 0) giterr_clear(); + git_config_entry_free(entry); return (int)val; } @@ -895,7 +981,8 @@ iter->iter->free(iter->iter); git__free(iter->name); - regfree(&iter->regex); + if (iter->have_regex) + regfree(&iter->regex); git__free(iter); } @@ -916,7 +1003,7 @@ if (regexp != NULL) { error = regcomp(&iter->regex, regexp, REG_EXTENDED); - if (error < 0) { + if (error != 0) { giterr_set_regex(&iter->regex, error); error = -1; regfree(&iter->regex); @@ -1107,6 +1194,26 @@ return -1; } +int git_config_lookup_map_enum(git_cvar_t *type_out, const char **str_out, + const git_cvar_map *maps, size_t map_n, int enum_val) +{ + size_t i; + + for (i = 0; i < map_n; i++) { + const git_cvar_map *m = &maps[i]; + + if (m->map_value != enum_val) + continue; + + *type_out = m->cvar_type; + *str_out = m->str_match; + return 0; + } + + giterr_set(GITERR_CONFIG, "invalid enum value"); + return GIT_ENOTFOUND; +} + int git_config_parse_bool(int *out, const char *value) { if (git__parse_bool(out, value) == 0) @@ -1184,6 +1291,36 @@ return -1; } +int git_config_parse_path(git_buf *out, const char *value) +{ + int error = 0; + const git_buf *home; + + assert(out && value); + + git_buf_sanitize(out); + + if (value[0] == '~') { + if (value[1] != '\0' && value[1] != '/') { + giterr_set(GITERR_CONFIG, "retrieving a homedir by name is not supported"); + return -1; + } + + if ((error = git_sysdir_get(&home, GIT_SYSDIR_GLOBAL)) < 0) + return error; + + git_buf_sets(out, home->ptr); + git_buf_puts(out, value + 1); + + if (git_buf_oom(out)) + return -1; + + return 0; + } + + return git_buf_sets(out, value); +} + /* Take something the user gave us and make it nice for our hash function */ int git_config__normalize_name(const char *in, char **out) { diff -Nru libgit2-0.22.2/src/config_cache.c libgit2-0.23.1/src/config_cache.c --- libgit2-0.22.2/src/config_cache.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/config_cache.c 2015-08-03 18:07:35.000000000 +0000 @@ -84,7 +84,7 @@ { int error = 0; struct map_data *data = &_cvar_maps[(int)cvar]; - const git_config_entry *entry; + git_config_entry *entry; git_config__lookup_entry(&entry, config, data->cvar_name, false); @@ -96,6 +96,7 @@ else error = git_config_parse_bool(out, entry->value); + git_config_entry_free(entry); return error; } diff -Nru libgit2-0.22.2/src/config_file.c libgit2-0.23.1/src/config_file.c --- libgit2-0.22.2/src/config_file.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/config_file.c 2015-08-03 18:07:35.000000000 +0000 @@ -21,7 +21,7 @@ #include #include -GIT__USE_STRMAP; +GIT__USE_STRMAP typedef struct cvar_t { struct cvar_t *next; @@ -96,7 +96,6 @@ /* mutex to coordinate accessing the values */ git_mutex values_mutex; refcounted_strmap *values; - int readonly; } diskfile_header; typedef struct { @@ -115,8 +114,7 @@ diskfile_backend *snapshot_from; } diskfile_readonly_backend; -static int config_parse(git_strmap *values, diskfile_backend *cfg_file, struct reader *reader, git_config_level_t level, int depth); -static int parse_variable(struct reader *reader, char **var_name, char **var_value); +static int config_read(git_strmap *values, diskfile_backend *cfg_file, struct reader *reader, git_config_level_t level, int depth); static int config_write(diskfile_backend *cfg, const char *key, const regex_t *preg, const char *value); static char *escape_value(const char *ptr); @@ -158,7 +156,7 @@ if (end && scan >= end) break; if (isalnum(*scan)) - *scan = (char)tolower(*scan); + *scan = (char)git__tolower(*scan); else if (*scan != '-' || scan == start) return GIT_EINVALIDSPEC; } @@ -289,7 +287,7 @@ if (res == GIT_ENOTFOUND) return 0; - if (res < 0 || (res = config_parse(b->header.values->values, b, reader, level, 0)) < 0) { + if (res < 0 || (res = config_read(b->header.values->values, b, reader, level, 0)) < 0) { refcounted_strmap_free(b->header.values); b->header.values = NULL; } @@ -314,7 +312,7 @@ reader = git_array_get(b->readers, git_array_size(b->readers) - 1); GITERR_CHECK_ALLOC(reader); - if ((error = config_parse(values->values, b, reader, b->level, 0)) < 0) + if ((error = config_read(values->values, b, reader, b->level, 0)) < 0) goto out; git_mutex_lock(&b->header.values_mutex); @@ -504,19 +502,26 @@ return ret; } +/* release the map containing the entry as an equivalent to freeing it */ +static void release_map(git_config_entry *entry) +{ + refcounted_strmap *map = (refcounted_strmap *) entry->payload; + refcounted_strmap_free(map); +} + /* * Internal function that actually gets the value in string form */ -static int config_get(git_config_backend *cfg, const char *key, const git_config_entry **out) +static int config_get(git_config_backend *cfg, const char *key, git_config_entry **out) { diskfile_header *h = (diskfile_header *)cfg; refcounted_strmap *map; git_strmap *values; khiter_t pos; cvar_t *var; - int error; + int error = 0; - if (!h->readonly && ((error = config_refresh(cfg)) < 0)) + if (!h->parent.readonly && ((error = config_refresh(cfg)) < 0)) return error; map = refcounted_strmap_take(h); @@ -534,9 +539,11 @@ while (var->next) var = var->next; - refcounted_strmap_free(map); *out = var->entry; - return 0; + (*out)->free = release_map; + (*out)->payload = map; + + return error; } static int config_set_multivar( @@ -568,7 +575,7 @@ } result = regcomp(&preg, regexp, REG_EXTENDED); - if (result < 0) { + if (result != 0) { giterr_set_regex(&preg, result); result = -1; goto out; @@ -654,7 +661,7 @@ refcounted_strmap_free(map); result = regcomp(&preg, regexp, REG_EXTENDED); - if (result < 0) { + if (result != 0) { giterr_set_regex(&preg, result); result = -1; goto out; @@ -763,7 +770,7 @@ refcounted_strmap *src_map; int error; - if (!src_header->readonly && (error = config_refresh(&src_header->parent)) < 0) + if (!src_header->parent.readonly && (error = config_refresh(&src_header->parent)) < 0) return error; /* We're just copying data, don't care about the level */ @@ -787,7 +794,7 @@ backend->snapshot_from = in; - backend->header.readonly = 1; + backend->header.parent.readonly = 1; backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION; backend->header.parent.open = config_readonly_open; backend->header.parent.get = config_get; @@ -823,7 +830,7 @@ if (c == 0) { reader->eof = 1; - c = '\n'; + c = '\0'; } return c; @@ -842,13 +849,12 @@ do { c = reader_getchar_raw(reader); - } while (skip_whitespace && git__isspace(c) && - !reader->eof); + } while (c != '\n' && c != '\0' && skip_whitespace && git__isspace(c)); if (skip_comments && (c == '#' || c == ';')) { do { c = reader_getchar_raw(reader); - } while (c != '\n'); + } while (c != '\n' && c != '\0'); } return c; @@ -885,7 +891,7 @@ { char *line = NULL; char *line_src, *line_end; - size_t line_len; + size_t line_len, alloc_len; line_src = reader->read_ptr; @@ -903,9 +909,10 @@ line_len = line_end - line_src; - line = git__malloc(line_len + 1); - if (line == NULL) + if (GIT_ADD_SIZET_OVERFLOW(&alloc_len, line_len, 1) || + (line = git__malloc(alloc_len)) == NULL) { return NULL; + } memcpy(line, line_src, line_len); @@ -958,6 +965,8 @@ int c, rpos; char *first_quote, *last_quote; git_buf buf = GIT_BUF_INIT; + size_t quoted_len, alloc_len, base_name_len = strlen(base_name); + /* * base_name is what came before the space. We should be at the * first quotation mark, except for now, line isn't being kept in @@ -966,13 +975,17 @@ first_quote = strchr(line, '"'); last_quote = strrchr(line, '"'); + quoted_len = last_quote - first_quote; - if (last_quote - first_quote == 0) { + if (quoted_len == 0) { set_parse_error(reader, 0, "Missing closing quotation mark in section header"); return -1; } - git_buf_grow(&buf, strlen(base_name) + last_quote - first_quote + 2); + GITERR_CHECK_ALLOC_ADD(&alloc_len, base_name_len, quoted_len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2); + + git_buf_grow(&buf, alloc_len); git_buf_printf(&buf, "%s.", base_name); rpos = 0; @@ -1029,6 +1042,7 @@ int name_length, c, pos; int result; char *line; + size_t line_len; line = reader_readline(reader, true); if (line == NULL) @@ -1042,7 +1056,8 @@ return -1; } - name = (char *)git__malloc((size_t)(name_end - line) + 1); + GITERR_CHECK_ALLOC_ADD(&line_len, (size_t)(name_end - line), 1); + name = git__malloc(line_len); GITERR_CHECK_ALLOC(name); name_length = 0; @@ -1068,7 +1083,7 @@ goto fail_parse; } - name[name_length++] = (char) tolower(c); + name[name_length++] = (char)git__tolower(c); } while ((c = line[pos++]) != ']'); @@ -1145,17 +1160,24 @@ static int strip_comments(char *line, int in_quotes) { - int quote_count = in_quotes; + int quote_count = in_quotes, backslash_count = 0; char *ptr; for (ptr = line; *ptr; ++ptr) { if (ptr[0] == '"' && ptr > line && ptr[-1] != '\\') quote_count++; - if ((ptr[0] == ';' || ptr[0] == '#') && (quote_count % 2) == 0) { + if ((ptr[0] == ';' || ptr[0] == '#') && + (quote_count % 2) == 0 && + (backslash_count % 2) == 0) { ptr[0] = '\0'; break; } + + if (ptr[0] == '\\') + backslash_count++; + else + backslash_count = 0; } /* skip any space at the end */ @@ -1176,135 +1198,410 @@ return git_path_join_unrooted(out, path, dir, NULL); } -static int config_parse(git_strmap *values, diskfile_backend *cfg_file, struct reader *reader, git_config_level_t level, int depth) +static const char *escapes = "ntb\"\\"; +static const char *escaped = "\n\t\b\"\\"; + +/* Escape the values to write them to the file */ +static char *escape_value(const char *ptr) { - int c; - char *current_section = NULL; - char *var_name; - char *var_value; - cvar_t *var; git_buf buf = GIT_BUF_INIT; - int result = 0; - uint32_t reader_idx; + size_t len; + const char *esc; - if (depth >= MAX_INCLUDE_DEPTH) { - giterr_set(GITERR_CONFIG, "Maximum config include depth reached"); + assert(ptr); + + len = strlen(ptr); + if (!len) + return git__calloc(1, sizeof(char)); + + git_buf_grow(&buf, len); + + while (*ptr != '\0') { + if ((esc = strchr(escaped, *ptr)) != NULL) { + git_buf_putc(&buf, '\\'); + git_buf_putc(&buf, escapes[esc - escaped]); + } else { + git_buf_putc(&buf, *ptr); + } + ptr++; + } + + if (git_buf_oom(&buf)) { + git_buf_free(&buf); + return NULL; + } + + return git_buf_detach(&buf); +} + +/* '\"' -> '"' etc */ +static int unescape_line( + char **out, bool *is_multi, const char *ptr, int quote_count) +{ + char *str, *fixed, *esc; + size_t ptr_len = strlen(ptr), alloc_len; + + *is_multi = false; + + if (GIT_ADD_SIZET_OVERFLOW(&alloc_len, ptr_len, 1) || + (str = git__malloc(alloc_len)) == NULL) { return -1; } - reader_idx = git_array_size(cfg_file->readers) - 1; - /* Initialize the reading position */ - reader->read_ptr = reader->buffer.ptr; - reader->eof = 0; + fixed = str; - /* If the file is empty, there's nothing for us to do */ - if (*reader->read_ptr == '\0') + while (*ptr != '\0') { + if (*ptr == '"') { + quote_count++; + } else if (*ptr != '\\') { + *fixed++ = *ptr; + } else { + /* backslash, check the next char */ + ptr++; + /* if we're at the end, it's a multiline, so keep the backslash */ + if (*ptr == '\0') { + *is_multi = true; + goto done; + } + if ((esc = strchr(escapes, *ptr)) != NULL) { + *fixed++ = escaped[esc - escapes]; + } else { + git__free(str); + giterr_set(GITERR_CONFIG, "Invalid escape at %s", ptr); + return -1; + } + } + ptr++; + } + +done: + *fixed = '\0'; + *out = str; + + return 0; +} + +static int parse_multiline_variable(struct reader *reader, git_buf *value, int in_quotes) +{ + char *line = NULL, *proc_line = NULL; + int quote_count; + bool multiline; + + /* Check that the next line exists */ + line = reader_readline(reader, false); + if (line == NULL) + return -1; + + /* We've reached the end of the file, there is no continuation. + * (this is not an error). + */ + if (line[0] == '\0') { + git__free(line); return 0; + } + + quote_count = strip_comments(line, !!in_quotes); + + /* If it was just a comment, pretend it didn't exist */ + if (line[0] == '\0') { + git__free(line); + return parse_multiline_variable(reader, value, quote_count); + /* TODO: unbounded recursion. This **could** be exploitable */ + } + + if (unescape_line(&proc_line, &multiline, line, in_quotes) < 0) { + git__free(line); + return -1; + } + /* add this line to the multiline var */ + + git_buf_puts(value, proc_line); + git__free(line); + git__free(proc_line); + + /* + * If we need to continue reading the next line, let's just + * keep putting stuff in the buffer + */ + if (multiline) + return parse_multiline_variable(reader, value, quote_count); + + return 0; +} + +GIT_INLINE(bool) is_namechar(char c) +{ + return isalnum(c) || c == '-'; +} + +static int parse_name( + char **name, const char **value, struct reader *reader, const char *line) +{ + const char *name_end = line, *value_start; + + *name = NULL; + *value = NULL; + + while (*name_end && is_namechar(*name_end)) + name_end++; + + if (line == name_end) { + set_parse_error(reader, 0, "Invalid configuration key"); + return -1; + } + + value_start = name_end; + + while (*value_start && git__isspace(*value_start)) + value_start++; + + if (*value_start == '=') { + *value = value_start + 1; + } else if (*value_start) { + set_parse_error(reader, 0, "Invalid configuration key"); + return -1; + } + + if ((*name = git__strndup(line, name_end - line)) == NULL) + return -1; + + return 0; +} + +static int parse_variable(struct reader *reader, char **var_name, char **var_value) +{ + const char *value_start = NULL; + char *line; + int quote_count; + bool multiline; + + line = reader_readline(reader, true); + if (line == NULL) + return -1; + + quote_count = strip_comments(line, 0); + + /* If there is no value, boolean true is assumed */ + *var_value = NULL; + + if (parse_name(var_name, &value_start, reader, line) < 0) + goto on_error; + + /* + * Now, let's try to parse the value + */ + if (value_start != NULL) { + while (git__isspace(value_start[0])) + value_start++; + + if (unescape_line(var_value, &multiline, value_start, 0) < 0) + goto on_error; + + if (multiline) { + git_buf multi_value = GIT_BUF_INIT; + git_buf_attach(&multi_value, *var_value, 0); + + if (parse_multiline_variable(reader, &multi_value, quote_count) < 0 || + git_buf_oom(&multi_value)) { + git_buf_free(&multi_value); + goto on_error; + } + + *var_value = git_buf_detach(&multi_value); + } + } + + git__free(line); + return 0; + +on_error: + git__free(*var_name); + git__free(line); + return -1; +} + +static int config_parse( + struct reader *reader, + int (*on_section)(struct reader **reader, const char *current_section, const char *line, size_t line_len, void *data), + int (*on_variable)(struct reader **reader, const char *current_section, char *var_name, char *var_value, const char *line, size_t line_len, void *data), + int (*on_comment)(struct reader **reader, const char *line, size_t line_len, void *data), + int (*on_eof)(struct reader **reader, void *data), + void *data) +{ + char *current_section = NULL, *var_name, *var_value, *line_start; + char c; + size_t line_len; + int result = 0; skip_bom(reader); while (result == 0 && !reader->eof) { + line_start = reader->read_ptr; c = reader_peek(reader, SKIP_WHITESPACE); switch (c) { - case '\n': /* EOF when peeking, set EOF in the reader to exit the loop */ + case '\0': /* EOF when peeking, set EOF in the reader to exit the loop */ reader->eof = 1; break; case '[': /* section header, new section begins */ git__free(current_section); current_section = NULL; - result = parse_section_header(reader, ¤t_section); + + if ((result = parse_section_header(reader, ¤t_section)) == 0 && on_section) { + line_len = reader->read_ptr - line_start; + result = on_section(&reader, current_section, line_start, line_len, data); + } break; + case '\n': /* comment or whitespace-only */ case ';': case '#': reader_consume_line(reader); + + if (on_comment) { + line_len = reader->read_ptr - line_start; + result = on_comment(&reader, line_start, line_len, data); + } break; default: /* assume variable declaration */ - result = parse_variable(reader, &var_name, &var_value); - if (result < 0) - break; - - git__strtolower(var_name); - git_buf_printf(&buf, "%s.%s", current_section, var_name); - git__free(var_name); - - if (git_buf_oom(&buf)) { - git__free(var_value); - return -1; + if ((result = parse_variable(reader, &var_name, &var_value)) == 0 && on_variable) { + line_len = reader->read_ptr - line_start; + result = on_variable(&reader, current_section, var_name, var_value, line_start, line_len, data); } + break; + } + } + + if (on_eof) + result = on_eof(&reader, data); - var = git__calloc(1, sizeof(cvar_t)); - GITERR_CHECK_ALLOC(var); - var->entry = git__calloc(1, sizeof(git_config_entry)); - GITERR_CHECK_ALLOC(var->entry); - - var->entry->name = git_buf_detach(&buf); - var->entry->value = var_value; - var->entry->level = level; - var->included = !!depth; - - - if ((result = append_entry(values, var)) < 0) - break; - else - result = 0; - - /* Add or append the new config option */ - if (!git__strcmp(var->entry->name, "include.path")) { - struct reader *r; - git_buf path = GIT_BUF_INIT; - char *dir; - uint32_t index; - - r = git_array_alloc(cfg_file->readers); - /* The reader may have been reallocated */ - reader = git_array_get(cfg_file->readers, reader_idx); - memset(r, 0, sizeof(struct reader)); - if ((result = git_path_dirname_r(&path, reader->file_path)) < 0) - break; - - /* We need to know our index in the array, as the next config_parse call may realloc */ - index = git_array_size(cfg_file->readers) - 1; - dir = git_buf_detach(&path); - result = included_path(&path, dir, var->entry->value); - git__free(dir); - - if (result < 0) - break; - - r->file_path = git_buf_detach(&path); - git_buf_init(&r->buffer, 0); - result = git_futils_readbuffer_updated(&r->buffer, r->file_path, &r->file_mtime, - &r->file_size, NULL); - - if (result == 0) { - result = config_parse(values, cfg_file, r, level, depth+1); - r = git_array_get(cfg_file->readers, index); - reader = git_array_get(cfg_file->readers, reader_idx); - } - else if (result == GIT_ENOTFOUND) { - giterr_clear(); - result = 0; - } + git__free(current_section); + return result; +} - git_buf_free(&r->buffer); +struct parse_data { + git_strmap *values; + diskfile_backend *cfg_file; + uint32_t reader_idx; + git_config_level_t level; + int depth; +}; - if (result < 0) - break; - } +static int read_on_variable( + struct reader **reader, + const char *current_section, + char *var_name, + char *var_value, + const char *line, + size_t line_len, + void *data) +{ + struct parse_data *parse_data = (struct parse_data *)data; + git_buf buf = GIT_BUF_INIT; + cvar_t *var; + int result = 0; - break; + GIT_UNUSED(line); + GIT_UNUSED(line_len); + + git__strtolower(var_name); + git_buf_printf(&buf, "%s.%s", current_section, var_name); + git__free(var_name); + + if (git_buf_oom(&buf)) { + git__free(var_value); + return -1; + } + + var = git__calloc(1, sizeof(cvar_t)); + GITERR_CHECK_ALLOC(var); + var->entry = git__calloc(1, sizeof(git_config_entry)); + GITERR_CHECK_ALLOC(var->entry); + + var->entry->name = git_buf_detach(&buf); + var->entry->value = var_value; + var->entry->level = parse_data->level; + var->included = !!parse_data->depth; + + if ((result = append_entry(parse_data->values, var)) < 0) + return result; + + result = 0; + + /* Add or append the new config option */ + if (!git__strcmp(var->entry->name, "include.path")) { + struct reader *r; + git_buf path = GIT_BUF_INIT; + char *dir; + uint32_t index; + + r = git_array_alloc(parse_data->cfg_file->readers); + /* The reader may have been reallocated */ + *reader = git_array_get(parse_data->cfg_file->readers, parse_data->reader_idx); + memset(r, 0, sizeof(struct reader)); + + if ((result = git_path_dirname_r(&path, (*reader)->file_path)) < 0) + return result; + + /* We need to know our index in the array, as the next config_parse call may realloc */ + index = git_array_size(parse_data->cfg_file->readers) - 1; + dir = git_buf_detach(&path); + result = included_path(&path, dir, var->entry->value); + git__free(dir); + + if (result < 0) + return result; + + r->file_path = git_buf_detach(&path); + git_buf_init(&r->buffer, 0); + + result = git_futils_readbuffer_updated( + &r->buffer, r->file_path, &r->file_mtime, &r->file_size, NULL); + + if (result == 0) { + result = config_read(parse_data->values, parse_data->cfg_file, r, parse_data->level, parse_data->depth+1); + r = git_array_get(parse_data->cfg_file->readers, index); + *reader = git_array_get(parse_data->cfg_file->readers, parse_data->reader_idx); + } else if (result == GIT_ENOTFOUND) { + giterr_clear(); + result = 0; } + + git_buf_free(&r->buffer); } - git__free(current_section); return result; } +static int config_read(git_strmap *values, diskfile_backend *cfg_file, struct reader *reader, git_config_level_t level, int depth) +{ + struct parse_data parse_data; + + if (depth >= MAX_INCLUDE_DEPTH) { + giterr_set(GITERR_CONFIG, "Maximum config include depth reached"); + return -1; + } + + /* Initialize the reading position */ + reader->read_ptr = reader->buffer.ptr; + reader->eof = 0; + + /* If the file is empty, there's nothing for us to do */ + if (*reader->read_ptr == '\0') + return 0; + + parse_data.values = values; + parse_data.cfg_file = cfg_file; + parse_data.reader_idx = git_array_size(cfg_file->readers) - 1; + parse_data.level = level; + parse_data.depth = depth; + + return config_parse(reader, NULL, read_on_variable, NULL, NULL, &parse_data); +} + static int write_section(git_filebuf *file, const char *key) { int result; @@ -1353,419 +1650,207 @@ return ""; } -/* - * This is pretty much the parsing, except we write out anything we don't have - */ -static int config_write(diskfile_backend *cfg, const char *key, const regex_t *preg, const char* value) -{ - int result, c; - int section_matches = 0, last_section_matched = 0, preg_replaced = 0, write_trailer = 0; - const char *pre_end = NULL, *post_start = NULL, *data_start, *write_start; - char *current_section = NULL, *section, *name, *ldot; - git_filebuf file = GIT_FILEBUF_INIT; - struct reader *reader = git_array_get(cfg->readers, 0); - - /* We need to read in our own config file */ - result = git_futils_readbuffer(&reader->buffer, cfg->file_path); - - /* Initialise the reading position */ - if (result == GIT_ENOTFOUND) { - reader->read_ptr = NULL; - reader->eof = 1; - data_start = NULL; - git_buf_clear(&reader->buffer); - } else if (result == 0) { - reader->read_ptr = reader->buffer.ptr; - reader->eof = 0; - data_start = reader->read_ptr; - } else { - return -1; /* OS error when reading the file */ - } - - write_start = data_start; - - /* Lock the file */ - if ((result = git_filebuf_open( - &file, cfg->file_path, 0, GIT_CONFIG_FILE_MODE)) < 0) { - git_buf_free(&reader->buffer); - return result; - } - - skip_bom(reader); - ldot = strrchr(key, '.'); - name = ldot + 1; - section = git__strndup(key, ldot - key); - - while (!reader->eof) { - c = reader_peek(reader, SKIP_WHITESPACE); - - if (c == '\0') { /* We've arrived at the end of the file */ - break; - - } else if (c == '[') { /* section header, new section begins */ - /* - * We set both positions to the current one in case we - * need to add a variable to the end of a section. In that - * case, we want both variables to point just before the - * new section. If we actually want to replace it, the - * default case will take care of updating them. - */ - pre_end = post_start = reader->read_ptr; - - git__free(current_section); - current_section = NULL; - if (parse_section_header(reader, ¤t_section) < 0) - goto rewrite_fail; - - /* Keep track of when it stops matching */ - last_section_matched = section_matches; - section_matches = !strcmp(current_section, section); - } - - else if (c == ';' || c == '#') { - reader_consume_line(reader); - } - - else { - /* - * If the section doesn't match, but the last section did, - * it means we need to add a variable (so skip the line - * otherwise). If both the section and name match, we need - * to overwrite the variable (so skip the line - * otherwise). pre_end needs to be updated each time so we - * don't loose that information, but we only need to - * update post_start if we're going to use it in this - * iteration. - */ - if (!section_matches) { - if (!last_section_matched) { - reader_consume_line(reader); - continue; - } - } else { - int has_matched = 0; - char *var_name, *var_value; - - pre_end = reader->read_ptr; - if (parse_variable(reader, &var_name, &var_value) < 0) - goto rewrite_fail; - - /* First try to match the name of the variable */ - if (strcasecmp(name, var_name) == 0) - has_matched = 1; - - /* If the name matches, and we have a regex to match the - * value, try to match it */ - if (has_matched && preg != NULL) - has_matched = (regexec(preg, var_value, 0, NULL, 0) == 0); - - git__free(var_name); - git__free(var_value); - - /* if there is no match, keep going */ - if (!has_matched) - continue; +struct write_data { + git_filebuf *file; + unsigned int in_section : 1, + preg_replaced : 1; + const char *section; + const char *name; + const regex_t *preg; + const char *value; +}; - post_start = reader->read_ptr; - } +static int write_line(struct write_data *write_data, const char *line, size_t line_len) +{ + int result = git_filebuf_write(write_data->file, line, line_len); - /* We've found the variable we wanted to change, so - * write anything up to it */ - git_filebuf_write(&file, write_start, pre_end - write_start); - preg_replaced = 1; - - /* Then replace the variable. If the value is NULL, it - * means we want to delete it, so don't write anything. */ - if (value != NULL) { - const char *q = quotes_for_value(value); - git_filebuf_printf(&file, "\t%s = %s%s%s\n", name, q, value, q); - } + if (!result && line_len && line[line_len-1] != '\n') + result = git_filebuf_printf(write_data->file, "\n"); - /* - * If we have a multivar, we should keep looking for entries, - * but only if we're in the right section. Otherwise we'll end up - * looping on the edge of a matching and a non-matching section. - */ - if (section_matches && preg != NULL) { - write_start = post_start; - continue; - } + return result; +} - write_trailer = 1; - break; /* break from the loop */ - } - } +static int write_value(struct write_data *write_data) +{ + const char *q; + int result; - /* - * Being here can mean that - * - * 1) our section is the last one in the file and we're - * adding a variable - * - * 2) we didn't find a section for us so we need to create it - * ourselves. - * - * 3) we're setting a multivar with a regex, which means we - * continue to search for matching values - * - * In the last case, if we've already replaced a value, we - * want to write the rest of the file. Otherwise we need to write - * out the whole file and then the new variable. + q = quotes_for_value(write_data->value); + result = git_filebuf_printf(write_data->file, + "\t%s = %s%s%s\n", write_data->name, q, write_data->value, q); + + /* If we are updating a single name/value, we're done. Setting `value` + * to `NULL` will prevent us from trying to write it again later (in + * `write_on_section`) if we see the same section repeated. */ - if (write_trailer) { - /* Write out rest of the file */ - git_filebuf_write(&file, post_start, reader->buffer.size - (post_start - data_start)); - } else { - if (preg_replaced) { - git_filebuf_printf(&file, "\n%s", write_start); - } else { - const char *q; - - git_filebuf_write(&file, reader->buffer.ptr, reader->buffer.size); - - if (reader->buffer.size > 0 && *(reader->buffer.ptr + reader->buffer.size - 1) != '\n') - git_filebuf_write(&file, "\n", 1); - - /* And now if we just need to add a variable */ - if (!section_matches && write_section(&file, section) < 0) - goto rewrite_fail; - - /* Sanity check: if we are here, and value is NULL, that means that somebody - * touched the config file after our initial read. We should probably assert() - * this, but instead we'll handle it gracefully with an error. */ - if (value == NULL) { - giterr_set(GITERR_CONFIG, - "race condition when writing a config file (a cvar has been removed)"); - goto rewrite_fail; - } - - /* If we are here, there is at least a section line */ - q = quotes_for_value(value); - git_filebuf_printf(&file, "\t%s = %s%s%s\n", name, q, value, q); - } - } - - git__free(section); - git__free(current_section); - - /* refresh stats - if this errors, then commit will error too */ - (void)git_filebuf_stats(&reader->file_mtime, &reader->file_size, &file); - - result = git_filebuf_commit(&file); - git_buf_free(&reader->buffer); + if (!write_data->preg) + write_data->value = NULL; return result; - -rewrite_fail: - git__free(section); - git__free(current_section); - - git_filebuf_cleanup(&file); - git_buf_free(&reader->buffer); - return -1; } -static const char *escapes = "ntb\"\\"; -static const char *escaped = "\n\t\b\"\\"; - -/* Escape the values to write them to the file */ -static char *escape_value(const char *ptr) +static int write_on_section( + struct reader **reader, + const char *current_section, + const char *line, + size_t line_len, + void *data) { - git_buf buf = GIT_BUF_INIT; - size_t len; - const char *esc; - - assert(ptr); + struct write_data *write_data = (struct write_data *)data; + int result = 0; - len = strlen(ptr); - if (!len) - return git__calloc(1, sizeof(char)); + GIT_UNUSED(reader); - git_buf_grow(&buf, len); + /* If we were previously in the correct section (but aren't anymore) + * and haven't written our value (for a simple name/value set, not + * a multivar), then append it to the end of the section before writing + * the new one. + */ + if (write_data->in_section && !write_data->preg && write_data->value) + result = write_value(write_data); - while (*ptr != '\0') { - if ((esc = strchr(escaped, *ptr)) != NULL) { - git_buf_putc(&buf, '\\'); - git_buf_putc(&buf, escapes[esc - escaped]); - } else { - git_buf_putc(&buf, *ptr); - } - ptr++; - } + write_data->in_section = strcmp(current_section, write_data->section) == 0; - if (git_buf_oom(&buf)) { - git_buf_free(&buf); - return NULL; - } + if (!result) + result = write_line(write_data, line, line_len); - return git_buf_detach(&buf); + return result; } -/* '\"' -> '"' etc */ -static char *fixup_line(const char *ptr, int quote_count) -{ - char *str = git__malloc(strlen(ptr) + 1); - char *out = str, *esc; +static int write_on_variable( + struct reader **reader, + const char *current_section, + char *var_name, + char *var_value, + const char *line, + size_t line_len, + void *data) +{ + struct write_data *write_data = (struct write_data *)data; + bool has_matched = false; + + GIT_UNUSED(reader); + GIT_UNUSED(current_section); + + /* See if we are to update this name/value pair; first examine name */ + if (write_data->in_section && + strcasecmp(write_data->name, var_name) == 0) + has_matched = true; + + /* If we have a regex to match the value, see if it matches */ + if (has_matched && write_data->preg != NULL) + has_matched = (regexec(write_data->preg, var_value, 0, NULL, 0) == 0); - if (str == NULL) - return NULL; + git__free(var_name); + git__free(var_value); - while (*ptr != '\0') { - if (*ptr == '"') { - quote_count++; - } else if (*ptr != '\\') { - *out++ = *ptr; - } else { - /* backslash, check the next char */ - ptr++; - /* if we're at the end, it's a multiline, so keep the backslash */ - if (*ptr == '\0') { - *out++ = '\\'; - goto out; - } - if ((esc = strchr(escapes, *ptr)) != NULL) { - *out++ = escaped[esc - escapes]; - } else { - git__free(str); - giterr_set(GITERR_CONFIG, "Invalid escape at %s", ptr); - return NULL; - } - } - ptr++; - } - -out: - *out = '\0'; + /* If this isn't the name/value we're looking for, simply dump the + * existing data back out and continue on. + */ + if (!has_matched) + return write_line(write_data, line, line_len); - return str; -} + write_data->preg_replaced = 1; -static int is_multiline_var(const char *str) -{ - int count = 0; - const char *end = str + strlen(str); - while (end > str && end[-1] == '\\') { - count++; - end--; - } + /* If value is NULL, we are deleting this value; write nothing. */ + if (!write_data->value) + return 0; - /* An odd number means last backslash wasn't escaped, so it's multiline */ - return count & 1; + return write_value(write_data); } -static int parse_multiline_variable(struct reader *reader, git_buf *value, int in_quotes) +static int write_on_comment(struct reader **reader, const char *line, size_t line_len, void *data) { - char *line = NULL, *proc_line = NULL; - int quote_count; - - /* Check that the next line exists */ - line = reader_readline(reader, false); - if (line == NULL) - return -1; - - /* We've reached the end of the file, there is input missing */ - if (line[0] == '\0') { - set_parse_error(reader, 0, "Unexpected end of file while parsing multine var"); - git__free(line); - return -1; - } + struct write_data *write_data; - quote_count = strip_comments(line, !!in_quotes); + GIT_UNUSED(reader); - /* If it was just a comment, pretend it didn't exist */ - if (line[0] == '\0') { - git__free(line); - return parse_multiline_variable(reader, value, quote_count); - /* TODO: unbounded recursion. This **could** be exploitable */ - } + write_data = (struct write_data *)data; + return write_line(write_data, line, line_len); +} - /* Drop the continuation character '\': to closely follow the UNIX - * standard, this character **has** to be last one in the buf, with - * no whitespace after it */ - assert(is_multiline_var(value->ptr)); - git_buf_shorten(value, 1); +static int write_on_eof(struct reader **reader, void *data) +{ + struct write_data *write_data = (struct write_data *)data; + int result = 0; - proc_line = fixup_line(line, in_quotes); - if (proc_line == NULL) { - git__free(line); - return -1; - } - /* add this line to the multiline var */ - git_buf_puts(value, proc_line); - git__free(line); - git__free(proc_line); + GIT_UNUSED(reader); - /* - * If we need to continue reading the next line, let's just - * keep putting stuff in the buffer + /* If we are at the EOF and have not written our value (again, for a + * simple name/value set, not a multivar) then we have never seen the + * section in question and should create a new section and write the + * value. */ - if (is_multiline_var(value->ptr)) - return parse_multiline_variable(reader, value, quote_count); + if ((!write_data->preg || !write_data->preg_replaced) && write_data->value) { + if ((result = write_section(write_data->file, write_data->section)) == 0) + result = write_value(write_data); + } - return 0; + return result; } -static int parse_variable(struct reader *reader, char **var_name, char **var_value) +/* + * This is pretty much the parsing, except we write out anything we don't have + */ +static int config_write(diskfile_backend *cfg, const char *key, const regex_t *preg, const char* value) { - const char *var_end = NULL; - const char *value_start = NULL; - char *line; - int quote_count; - - line = reader_readline(reader, true); - if (line == NULL) - return -1; - - quote_count = strip_comments(line, 0); + int result; + char *section, *name, *ldot; + git_filebuf file = GIT_FILEBUF_INIT; + struct reader *reader = git_array_get(cfg->readers, 0); + struct write_data write_data; - var_end = strchr(line, '='); + /* Lock the file */ + if ((result = git_filebuf_open( + &file, cfg->file_path, 0, GIT_CONFIG_FILE_MODE)) < 0) { + git_buf_free(&reader->buffer); + return result; + } - if (var_end == NULL) - var_end = strchr(line, '\0'); - else - value_start = var_end + 1; + /* We need to read in our own config file */ + result = git_futils_readbuffer(&reader->buffer, cfg->file_path); - do var_end--; - while (var_end>line && git__isspace(*var_end)); + /* Initialise the reading position */ + if (result == GIT_ENOTFOUND) { + reader->read_ptr = NULL; + reader->eof = 1; + git_buf_clear(&reader->buffer); + } else if (result == 0) { + reader->read_ptr = reader->buffer.ptr; + reader->eof = 0; + } else { + git_filebuf_cleanup(&file); + return -1; /* OS error when reading the file */ + } - *var_name = git__strndup(line, var_end - line + 1); - GITERR_CHECK_ALLOC(*var_name); + ldot = strrchr(key, '.'); + name = ldot + 1; + section = git__strndup(key, ldot - key); - /* If there is no value, boolean true is assumed */ - *var_value = NULL; + write_data.file = &file; + write_data.section = section; + write_data.in_section = 0; + write_data.preg_replaced = 0; + write_data.name = name; + write_data.preg = preg; + write_data.value = value; - /* - * Now, let's try to parse the value - */ - if (value_start != NULL) { - while (git__isspace(value_start[0])) - value_start++; + result = config_parse(reader, write_on_section, write_on_variable, write_on_comment, write_on_eof, &write_data); + git__free(section); - if (is_multiline_var(value_start)) { - git_buf multi_value = GIT_BUF_INIT; - char *proc_line = fixup_line(value_start, 0); - GITERR_CHECK_ALLOC(proc_line); - git_buf_puts(&multi_value, proc_line); - git__free(proc_line); - if (parse_multiline_variable(reader, &multi_value, quote_count) < 0 || git_buf_oom(&multi_value)) { - git__free(*var_name); - git__free(line); - git_buf_free(&multi_value); - return -1; - } + if (result < 0) { + git_filebuf_cleanup(&file); + goto done; + } - *var_value = git_buf_detach(&multi_value); + /* refresh stats - if this errors, then commit will error too */ + (void)git_filebuf_stats(&reader->file_mtime, &reader->file_size, &file); - } - else if (value_start[0] != '\0') { - *var_value = fixup_line(value_start, 0); - GITERR_CHECK_ALLOC(*var_value); - } else { /* equals sign but missing rhs */ - *var_value = git__strdup(""); - GITERR_CHECK_ALLOC(*var_value); - } - } + result = git_filebuf_commit(&file); + git_buf_free(&reader->buffer); - git__free(line); - return 0; +done: + git_buf_free(&reader->buffer); + return result; } + diff -Nru libgit2-0.22.2/src/config_file.h libgit2-0.23.1/src/config_file.h --- libgit2-0.22.2/src/config_file.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/config_file.h 2015-08-03 18:07:35.000000000 +0000 @@ -21,7 +21,7 @@ } GIT_INLINE(int) git_config_file_get_string( - const git_config_entry **out, git_config_backend *cfg, const char *name) + git_config_entry **out, git_config_backend *cfg, const char *name) { return cfg->get(cfg, name, out); } diff -Nru libgit2-0.22.2/src/config.h libgit2-0.23.1/src/config.h --- libgit2-0.22.2/src/config.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/config.h 2015-08-03 18:07:35.000000000 +0000 @@ -48,7 +48,7 @@ /* internal only: does not normalize key and sets out to NULL if not found */ extern int git_config__lookup_entry( - const git_config_entry **out, + git_config_entry **out, const git_config *cfg, const char *key, bool no_errors); @@ -67,7 +67,7 @@ * failures occur while trying to access the value. */ -extern const char *git_config__get_string_force( +extern char *git_config__get_string_force( const git_config *cfg, const char *key, const char *fallback_value); extern int git_config__get_bool_force( @@ -82,4 +82,10 @@ extern int git_config__cvar( int *out, git_config *config, git_cvar_cached cvar); +/** + * The opposite of git_config_lookup_map_value, we take an enum value + * and map it to the string or bool value on the config. + */ +int git_config_lookup_map_enum(git_cvar_t *type_out, const char **str_out, + const git_cvar_map *maps, size_t map_n, int enum_val); #endif diff -Nru libgit2-0.22.2/src/crlf.c libgit2-0.23.1/src/crlf.c --- libgit2-0.22.2/src/crlf.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/crlf.c 2015-08-03 18:07:35.000000000 +0000 @@ -193,28 +193,29 @@ case GIT_CRLF_CRLF: return "\r\n"; + case GIT_CRLF_GUESS: + if (ca->auto_crlf == GIT_AUTO_CRLF_FALSE) + return "\n"; + break; + case GIT_CRLF_AUTO: case GIT_CRLF_TEXT: - case GIT_CRLF_GUESS: break; default: goto line_ending_error; } - switch (ca->eol) { - case GIT_EOL_UNSET: - return GIT_EOL_NATIVE == GIT_EOL_CRLF ? "\r\n" : "\n"; - - case GIT_EOL_CRLF: + if (ca->auto_crlf == GIT_AUTO_CRLF_TRUE) return "\r\n"; - - case GIT_EOL_LF: + else if (ca->auto_crlf == GIT_AUTO_CRLF_INPUT) return "\n"; - - default: - goto line_ending_error; - } + else if (ca->eol == GIT_EOL_UNSET) + return GIT_EOL_NATIVE == GIT_EOL_CRLF ? "\r\n" : "\n"; + else if (ca->eol == GIT_EOL_LF) + return "\n"; + else if (ca->eol == GIT_EOL_CRLF) + return "\r\n"; line_ending_error: giterr_set(GITERR_INVALID, "Invalid input to line ending filter"); @@ -224,16 +225,14 @@ static int crlf_apply_to_workdir( struct crlf_attrs *ca, git_buf *to, const git_buf *from) { + git_buf_text_stats stats; const char *workdir_ending = NULL; + bool is_binary; /* Empty file? Nothing to do. */ if (git_buf_len(from) == 0) return 0; - /* Don't filter binary files */ - if (git_buf_text_is_binary(from)) - return GIT_PASSTHROUGH; - /* Determine proper line ending */ workdir_ending = line_ending(ca); if (!workdir_ending) @@ -243,6 +242,29 @@ if (strcmp(workdir_ending, "\r\n") != 0) return GIT_PASSTHROUGH; + /* If there are no LFs, or all LFs are part of a CRLF, nothing to do */ + is_binary = git_buf_text_gather_stats(&stats, from, false); + + if (stats.lf == 0 || stats.lf == stats.crlf) + return GIT_PASSTHROUGH; + + if (ca->crlf_action == GIT_CRLF_AUTO || + ca->crlf_action == GIT_CRLF_GUESS) { + + /* If we have any existing CR or CRLF line endings, do nothing */ + if (ca->crlf_action == GIT_CRLF_GUESS && + stats.cr > 0 && stats.crlf > 0) + return GIT_PASSTHROUGH; + + /* If we have bare CR characters, do nothing */ + if (stats.cr != stats.crlf) + return GIT_PASSTHROUGH; + + /* Don't filter binary files */ + if (is_binary) + return GIT_PASSTHROUGH; + } + return git_buf_text_lf_to_crlf(to, from); } @@ -278,7 +300,7 @@ return GIT_PASSTHROUGH; if (ca.crlf_action == GIT_CRLF_GUESS || - (ca.crlf_action == GIT_CRLF_AUTO && + ((ca.crlf_action == GIT_CRLF_AUTO || ca.crlf_action == GIT_CRLF_TEXT) && git_filter_source_mode(src) == GIT_FILTER_SMUDGE)) { error = git_repository__cvar( @@ -302,7 +324,7 @@ return error; /* downgrade FAIL to WARN if ALLOW_UNSAFE option is used */ - if ((git_filter_source_options(src) & GIT_FILTER_OPT_ALLOW_UNSAFE) && + if ((git_filter_source_flags(src) & GIT_FILTER_ALLOW_UNSAFE) && ca.safe_crlf == GIT_SAFE_CRLF_FAIL) ca.safe_crlf = GIT_SAFE_CRLF_WARN; } diff -Nru libgit2-0.22.2/src/curl_stream.c libgit2-0.23.1/src/curl_stream.c --- libgit2-0.22.2/src/curl_stream.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/curl_stream.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,257 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#ifdef GIT_CURL + +#include + +#include "stream.h" +#include "git2/transport.h" +#include "buffer.h" +#include "vector.h" + +typedef struct { + git_stream parent; + CURL *handle; + curl_socket_t socket; + char curl_error[CURL_ERROR_SIZE + 1]; + git_cert_x509 cert_info; + git_strarray cert_info_strings; +} curl_stream; + +static int seterr_curl(curl_stream *s) +{ + giterr_set(GITERR_NET, "curl error: %s\n", s->curl_error); + return -1; +} + +static int curls_connect(git_stream *stream) +{ + curl_stream *s = (curl_stream *) stream; + long sockextr; + int failed_cert = 0; + CURLcode res; + res = curl_easy_perform(s->handle); + + if (res != CURLE_OK && res != CURLE_PEER_FAILED_VERIFICATION) + return seterr_curl(s); + if (res == CURLE_PEER_FAILED_VERIFICATION) + failed_cert = 1; + + if ((res = curl_easy_getinfo(s->handle, CURLINFO_LASTSOCKET, &sockextr)) != CURLE_OK) + return seterr_curl(s); + + s->socket = sockextr; + + if (s->parent.encrypted && failed_cert) + return GIT_ECERTIFICATE; + + return 0; +} + +static int curls_certificate(git_cert **out, git_stream *stream) +{ + int error; + CURLcode res; + struct curl_slist *slist; + struct curl_certinfo *certinfo; + git_vector strings = GIT_VECTOR_INIT; + curl_stream *s = (curl_stream *) stream; + + if ((res = curl_easy_getinfo(s->handle, CURLINFO_CERTINFO, &certinfo)) != CURLE_OK) + return seterr_curl(s); + + /* No information is available, can happen with SecureTransport */ + if (certinfo->num_of_certs == 0) { + s->cert_info.cert_type = GIT_CERT_NONE; + s->cert_info.data = NULL; + s->cert_info.len = 0; + return 0; + } + + if ((error = git_vector_init(&strings, 8, NULL)) < 0) + return error; + + for (slist = certinfo->certinfo[0]; slist; slist = slist->next) { + char *str = git__strdup(slist->data); + GITERR_CHECK_ALLOC(str); + } + + /* Copy the contents of the vector into a strarray so we can expose them */ + s->cert_info_strings.strings = (char **) strings.contents; + s->cert_info_strings.count = strings.length; + + s->cert_info.cert_type = GIT_CERT_STRARRAY; + s->cert_info.data = &s->cert_info_strings; + s->cert_info.len = strings.length; + + *out = (git_cert *) &s->cert_info; + + return 0; +} + +static int curls_set_proxy(git_stream *stream, const char *proxy_url) +{ + CURLcode res; + curl_stream *s = (curl_stream *) stream; + + if ((res = curl_easy_setopt(s->handle, CURLOPT_PROXY, proxy_url)) != CURLE_OK) + return seterr_curl(s); + + return 0; +} + +static int wait_for(curl_socket_t fd, bool reading) +{ + int ret; + fd_set infd, outfd, errfd; + + FD_ZERO(&infd); + FD_ZERO(&outfd); + FD_ZERO(&errfd); + + FD_SET(fd, &errfd); + if (reading) + FD_SET(fd, &infd); + else + FD_SET(fd, &outfd); + + if ((ret = select(fd + 1, &infd, &outfd, &errfd, NULL)) < 0) { + giterr_set(GITERR_OS, "error in select"); + return -1; + } + + return 0; +} + +static ssize_t curls_write(git_stream *stream, const char *data, size_t len, int flags) +{ + int error; + size_t off = 0, sent; + CURLcode res; + curl_stream *s = (curl_stream *) stream; + + GIT_UNUSED(flags); + + do { + if ((error = wait_for(s->socket, false)) < 0) + return error; + + res = curl_easy_send(s->handle, data + off, len - off, &sent); + if (res == CURLE_OK) + off += sent; + } while ((res == CURLE_OK || res == CURLE_AGAIN) && off < len); + + if (res != CURLE_OK) + return seterr_curl(s); + + return len; +} + +static ssize_t curls_read(git_stream *stream, void *data, size_t len) +{ + int error; + size_t read; + CURLcode res; + curl_stream *s = (curl_stream *) stream; + + do { + if ((error = wait_for(s->socket, true)) < 0) + return error; + + res = curl_easy_recv(s->handle, data, len, &read); + } while (res == CURLE_AGAIN); + + if (res != CURLE_OK) + return seterr_curl(s); + + return read; +} + +static int curls_close(git_stream *stream) +{ + curl_stream *s = (curl_stream *) stream; + + if (!s->handle) + return 0; + + curl_easy_cleanup(s->handle); + s->handle = NULL; + s->socket = 0; + + return 0; +} + +static void curls_free(git_stream *stream) +{ + curl_stream *s = (curl_stream *) stream; + + curls_close(stream); + git_strarray_free(&s->cert_info_strings); + git__free(s); +} + +int git_curl_stream_new(git_stream **out, const char *host, const char *port) +{ + curl_stream *st; + CURL *handle; + int iport = 0, error; + + st = git__calloc(1, sizeof(curl_stream)); + GITERR_CHECK_ALLOC(st); + + handle = curl_easy_init(); + if (handle == NULL) { + giterr_set(GITERR_NET, "failed to create curl handle"); + return -1; + } + + if ((error = git__strtol32(&iport, port, NULL, 10)) < 0) + return error; + + curl_easy_setopt(handle, CURLOPT_URL, host); + curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, st->curl_error); + curl_easy_setopt(handle, CURLOPT_PORT, iport); + curl_easy_setopt(handle, CURLOPT_CONNECT_ONLY, 1); + curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1); + curl_easy_setopt(handle, CURLOPT_CERTINFO, 1); + curl_easy_setopt(handle, CURLOPT_HTTPPROXYTUNNEL, 1); + + /* curl_easy_setopt(handle, CURLOPT_VERBOSE, 1); */ + + st->parent.version = GIT_STREAM_VERSION; + st->parent.encrypted = 0; /* we don't encrypt ourselves */ + st->parent.proxy_support = 1; + st->parent.connect = curls_connect; + st->parent.certificate = curls_certificate; + st->parent.set_proxy = curls_set_proxy; + st->parent.read = curls_read; + st->parent.write = curls_write; + st->parent.close = curls_close; + st->parent.free = curls_free; + st->handle = handle; + + *out = (git_stream *) st; + return 0; +} + +#else + +#include "stream.h" + +int git_curl_stream_new(git_stream **out, const char *host, const char *port) +{ + GIT_UNUSED(out); + GIT_UNUSED(host); + GIT_UNUSED(port); + + giterr_set(GITERR_NET, "curl is not supported in this version"); + return -1; +} + + +#endif diff -Nru libgit2-0.22.2/src/curl_stream.h libgit2-0.23.1/src/curl_stream.h --- libgit2-0.22.2/src/curl_stream.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/curl_stream.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,14 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_curl_stream_h__ +#define INCLUDE_curl_stream_h__ + +#include "git2/sys/stream.h" + +extern int git_curl_stream_new(git_stream **out, const char *host, const char *port); + +#endif diff -Nru libgit2-0.22.2/src/delta-apply.c libgit2-0.23.1/src/delta-apply.c --- libgit2-0.22.2/src/delta-apply.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/delta-apply.c 2015-08-03 18:07:35.000000000 +0000 @@ -57,7 +57,7 @@ size_t delta_len) { const unsigned char *delta_end = delta + delta_len; - size_t base_sz, res_sz; + size_t base_sz, res_sz, alloc_sz; unsigned char *res_dp; /* Check that the base size matches the data we were given; @@ -74,7 +74,8 @@ return -1; } - res_dp = git__malloc(res_sz + 1); + GITERR_CHECK_ALLOC_ADD(&alloc_sz, res_sz, 1); + res_dp = git__malloc(alloc_sz); GITERR_CHECK_ALLOC(res_dp); res_dp[res_sz] = '\0'; diff -Nru libgit2-0.22.2/src/delta.c libgit2-0.23.1/src/delta.c --- libgit2-0.22.2/src/delta.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/delta.c 2015-08-03 18:07:35.000000000 +0000 @@ -119,6 +119,29 @@ struct index_entry *hash[GIT_FLEX_ARRAY]; }; +static int lookup_index_alloc( + void **out, unsigned long *out_len, size_t entries, size_t hash_count) +{ + size_t entries_len, hash_len, index_len; + + GITERR_CHECK_ALLOC_MULTIPLY(&entries_len, entries, sizeof(struct index_entry)); + GITERR_CHECK_ALLOC_MULTIPLY(&hash_len, hash_count, sizeof(struct index_entry *)); + + GITERR_CHECK_ALLOC_ADD(&index_len, sizeof(struct git_delta_index), entries_len); + GITERR_CHECK_ALLOC_ADD(&index_len, index_len, hash_len); + + if (!git__is_ulong(index_len)) { + giterr_set(GITERR_NOMEMORY, "Overly large delta"); + return -1; + } + + *out = git__malloc(index_len); + GITERR_CHECK_ALLOC(*out); + + *out_len = index_len; + return 0; +} + struct git_delta_index * git_delta_create_index(const void *buf, unsigned long bufsize) { @@ -148,13 +171,9 @@ hsize = 1 << i; hmask = hsize - 1; - /* allocate lookup index */ - memsize = sizeof(*index) + - sizeof(*hash) * hsize + - sizeof(*entry) * entries; - mem = git__malloc(memsize); - if (!mem) + if (lookup_index_alloc(&mem, &memsize, entries, hsize) < 0) return NULL; + index = mem; mem = index->hash; hash = mem; diff -Nru libgit2-0.22.2/src/describe.c libgit2-0.23.1/src/describe.c --- libgit2-0.22.2/src/describe.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/describe.c 2015-08-03 18:07:35.000000000 +0000 @@ -19,6 +19,8 @@ #include "vector.h" #include "repository.h" +GIT__USE_OIDMAP + /* Ported from https://github.com/git/git/blob/89dde7882f71f846ccd0359756d27bebc31108de/builtin/describe.c */ struct commit_name { @@ -691,7 +693,7 @@ get_name, &data)) < 0) goto cleanup; - if (git_oidmap_size(data.names) == 0) { + if (git_oidmap_size(data.names) == 0 && !opts->show_commit_oid_as_fallback) { giterr_set(GITERR_DESCRIBE, "Cannot describe - " "No reference found, cannot describe anything."); error = -1; diff -Nru libgit2-0.22.2/src/diff.c libgit2-0.23.1/src/diff.c --- libgit2-0.22.2/src/diff.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff.c 2015-08-03 18:07:35.000000000 +0000 @@ -77,11 +77,24 @@ static int diff_delta__from_one( git_diff *diff, git_delta_t status, - const git_index_entry *entry) + const git_index_entry *oitem, + const git_index_entry *nitem) { + const git_index_entry *entry = nitem; + bool has_old = false; git_diff_delta *delta; const char *matched_pathspec; + assert((oitem != NULL) ^ (nitem != NULL)); + + if (oitem) { + entry = oitem; + has_old = true; + } + + if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) + has_old = !has_old; + if ((entry->flags & GIT_IDXENTRY_VALID) != 0) return 0; @@ -111,20 +124,21 @@ assert(status != GIT_DELTA_MODIFIED); delta->nfiles = 1; - if (delta->status == GIT_DELTA_DELETED) { + if (has_old) { delta->old_file.mode = entry->mode; delta->old_file.size = entry->file_size; + delta->old_file.flags |= GIT_DIFF_FLAG_EXISTS; git_oid_cpy(&delta->old_file.id, &entry->id); } else /* ADDED, IGNORED, UNTRACKED */ { delta->new_file.mode = entry->mode; delta->new_file.size = entry->file_size; + delta->new_file.flags |= GIT_DIFF_FLAG_EXISTS; git_oid_cpy(&delta->new_file.id, &entry->id); } delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID; - if (delta->status == GIT_DELTA_DELETED || - !git_oid_iszero(&delta->new_file.id)) + if (has_old || !git_oid_iszero(&delta->new_file.id)) delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID; return diff_insert_delta(diff, delta, matched_pathspec); @@ -137,9 +151,10 @@ uint32_t old_mode, const git_index_entry *new_entry, uint32_t new_mode, - git_oid *new_oid, + const git_oid *new_id, const char *matched_pathspec) { + const git_oid *old_id = &old_entry->id; git_diff_delta *delta; const char *canonical_path = old_entry->path; @@ -147,38 +162,45 @@ DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_INCLUDE_UNMODIFIED)) return 0; + if (!new_id) + new_id = &new_entry->id; + if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) { uint32_t temp_mode = old_mode; const git_index_entry *temp_entry = old_entry; + const git_oid *temp_id = old_id; + old_entry = new_entry; new_entry = temp_entry; old_mode = new_mode; new_mode = temp_mode; + old_id = new_id; + new_id = temp_id; } delta = diff_delta__alloc(diff, status, canonical_path); GITERR_CHECK_ALLOC(delta); delta->nfiles = 2; - git_oid_cpy(&delta->old_file.id, &old_entry->id); - delta->old_file.size = old_entry->file_size; - delta->old_file.mode = old_mode; - delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID; + if (!git_index_entry_is_conflict(old_entry)) { + delta->old_file.size = old_entry->file_size; + delta->old_file.mode = old_mode; + git_oid_cpy(&delta->old_file.id, old_id); + delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID | + GIT_DIFF_FLAG_EXISTS; + } + + if (!git_index_entry_is_conflict(new_entry)) { + git_oid_cpy(&delta->new_file.id, new_id); + delta->new_file.size = new_entry->file_size; + delta->new_file.mode = new_mode; + delta->old_file.flags |= GIT_DIFF_FLAG_EXISTS; + delta->new_file.flags |= GIT_DIFF_FLAG_EXISTS; - git_oid_cpy(&delta->new_file.id, &new_entry->id); - delta->new_file.size = new_entry->file_size; - delta->new_file.mode = new_mode; - - if (new_oid) { - if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE)) - git_oid_cpy(&delta->old_file.id, new_oid); - else - git_oid_cpy(&delta->new_file.id, new_oid); + if (!git_oid_iszero(&new_entry->id)) + delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID; } - if (new_oid || !git_oid_iszero(&new_entry->id)) - delta->new_file.flags |= GIT_DIFF_FLAG_VALID_ID; - return diff_insert_delta(diff, delta, matched_pathspec); } @@ -327,6 +349,22 @@ return pfx; } +static int diff_entry_cmp(const void *a, const void *b) +{ + const git_index_entry *entry_a = a; + const git_index_entry *entry_b = b; + + return strcmp(entry_a->path, entry_b->path); +} + +static int diff_entry_icmp(const void *a, const void *b) +{ + const git_index_entry *entry_a = a; + const git_index_entry *entry_b = b; + + return strcasecmp(entry_a->path, entry_b->path); +} + static void diff_set_ignore_case(git_diff *diff, bool ignore_case) { if (!ignore_case) { @@ -335,7 +373,7 @@ diff->strcomp = git__strcmp; diff->strncomp = git__strncmp; diff->pfxcomp = git__prefixcmp; - diff->entrycomp = git_index_entry_cmp; + diff->entrycomp = diff_entry_cmp; git_vector_set_cmp(&diff->deltas, git_diff_delta__cmp); } else { @@ -344,7 +382,7 @@ diff->strcomp = git__strcasecmp; diff->strncomp = git__strncasecmp; diff->pfxcomp = git__prefixcmp_icase; - diff->entrycomp = git_index_entry_icmp; + diff->entrycomp = diff_entry_icmp; git_vector_set_cmp(&diff->deltas, git_diff_delta__casecmp); } @@ -461,12 +499,13 @@ /* if ignore_submodules not explicitly set, check diff config */ if (diff->opts.ignore_submodules <= 0) { - const git_config_entry *entry; + git_config_entry *entry; git_config__lookup_entry(&entry, cfg, "diff.ignoresubmodules", true); if (entry && git_submodule_parse_ignore( &diff->opts.ignore_submodules, entry->value) < 0) giterr_clear(); + git_config_entry_free(entry); } /* if either prefix is not set, figure out appropriate value */ @@ -531,7 +570,7 @@ git_oid *out, git_diff *diff, const char *path, - uint16_t mode, + uint16_t mode, git_off_t size) { git_index_entry entry; @@ -541,13 +580,14 @@ entry.file_size = size; entry.path = (char *)path; - return git_diff__oid_for_entry(out, diff, &entry, NULL); + return git_diff__oid_for_entry(out, diff, &entry, mode, NULL); } int git_diff__oid_for_entry( git_oid *out, git_diff *diff, const git_index_entry *src, + uint16_t mode, const git_oid *update_match) { int error = 0; @@ -561,7 +601,7 @@ &full_path, git_repository_workdir(diff->repo), entry.path) < 0) return -1; - if (!entry.mode) { + if (!mode) { struct stat st; diff->perf.stat_calls++; @@ -577,7 +617,7 @@ } /* calculate OID for file if possible */ - if (S_ISGITLINK(entry.mode)) { + if (S_ISGITLINK(mode)) { git_submodule *sm; if (!git_submodule_lookup(&sm, diff->repo, entry.path)) { @@ -591,7 +631,7 @@ */ giterr_clear(); } - } else if (S_ISLNK(entry.mode)) { + } else if (S_ISLNK(mode)) { error = git_odb__hashlink(out, full_path.ptr); diff->perf.oid_calculations++; } else if (!git__is_sizet(entry.file_size)) { @@ -600,7 +640,7 @@ error = -1; } else if (!(error = git_filter_list_load( &fl, diff->repo, NULL, entry.path, - GIT_FILTER_TO_ODB, GIT_FILTER_OPT_ALLOW_UNSAFE))) + GIT_FILTER_TO_ODB, GIT_FILTER_ALLOW_UNSAFE))) { int fd = git_futils_open_ro(full_path.ptr); if (fd < 0) @@ -618,11 +658,15 @@ /* update index for entry if requested */ if (!error && update_match && git_oid_equal(out, update_match)) { git_index *idx; + git_index_entry updated_entry; - if (!(error = git_repository_index(&idx, diff->repo))) { - memcpy(&entry.id, out, sizeof(entry.id)); - error = git_index_add(idx, &entry); - git_index_free(idx); + memcpy(&updated_entry, &entry, sizeof(git_index_entry)); + updated_entry.mode = mode; + git_oid_cpy(&updated_entry.id, out); + + if (!(error = git_repository_index__weakptr(&idx, diff->repo))) { + error = git_index_add(idx, &updated_entry); + diff->index_updated = true; } } @@ -731,47 +775,54 @@ new_is_workdir) nmode = (nmode & ~MODE_BITS_MASK) | (omode & MODE_BITS_MASK); + /* if one side is a conflict, mark the whole delta as conflicted */ + if (git_index_entry_is_conflict(oitem) || + git_index_entry_is_conflict(nitem)) { + status = GIT_DELTA_CONFLICTED; + /* support "assume unchanged" (poorly, b/c we still stat everything) */ - if ((oitem->flags & GIT_IDXENTRY_VALID) != 0) + } else if ((oitem->flags & GIT_IDXENTRY_VALID) != 0) { status = GIT_DELTA_UNMODIFIED; /* support "skip worktree" index bit */ - else if ((oitem->flags_extended & GIT_IDXENTRY_SKIP_WORKTREE) != 0) + } else if ((oitem->flags_extended & GIT_IDXENTRY_SKIP_WORKTREE) != 0) { status = GIT_DELTA_UNMODIFIED; /* if basic type of file changed, then split into delete and add */ - else if (GIT_MODE_TYPE(omode) != GIT_MODE_TYPE(nmode)) { - if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE)) + } else if (GIT_MODE_TYPE(omode) != GIT_MODE_TYPE(nmode)) { + if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_TYPECHANGE)) { status = GIT_DELTA_TYPECHANGE; + } + else if (nmode == GIT_FILEMODE_UNREADABLE) { - if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem))) - error = diff_delta__from_one(diff, GIT_DELTA_UNREADABLE, nitem); + if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL))) + error = diff_delta__from_one(diff, GIT_DELTA_UNREADABLE, NULL, nitem); return error; } + else { - if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem))) - error = diff_delta__from_one(diff, GIT_DELTA_ADDED, nitem); + if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL))) + error = diff_delta__from_one(diff, GIT_DELTA_ADDED, NULL, nitem); return error; } - } /* if oids and modes match (and are valid), then file is unmodified */ - else if (git_oid_equal(&oitem->id, &nitem->id) && + } else if (git_oid_equal(&oitem->id, &nitem->id) && omode == nmode && - !git_oid_iszero(&oitem->id)) + !git_oid_iszero(&oitem->id)) { status = GIT_DELTA_UNMODIFIED; /* if we have an unknown OID and a workdir iterator, then check some * circumstances that can accelerate things or need special handling */ - else if (git_oid_iszero(&nitem->id) && new_is_workdir) { + } else if (git_oid_iszero(&nitem->id) && new_is_workdir) { bool use_ctime = ((diff->diffcaps & GIT_DIFFCAPS_TRUST_CTIME) != 0); bool use_nanos = ((diff->diffcaps & GIT_DIFFCAPS_TRUST_NANOSECS) != 0); + git_index *index; + git_iterator_index(&index, info->new_iter); status = GIT_DELTA_UNMODIFIED; - /* TODO: add check against index file st_mtime to avoid racy-git */ - if (S_ISGITLINK(nmode)) { if ((error = maybe_modified_submodule(&status, &noid, diff, info)) < 0) return error; @@ -790,31 +841,30 @@ !diff_time_eq(&oitem->ctime, &nitem->ctime, use_nanos)) || oitem->ino != nitem->ino || oitem->uid != nitem->uid || - oitem->gid != nitem->gid) + oitem->gid != nitem->gid || + (index && nitem->mtime.seconds >= index->stamp.mtime)) { status = GIT_DELTA_MODIFIED; modified_uncertain = true; } - } /* if mode is GITLINK and submodules are ignored, then skip */ - else if (S_ISGITLINK(nmode) && - DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES)) + } else if (S_ISGITLINK(nmode) && + DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_SUBMODULES)) { status = GIT_DELTA_UNMODIFIED; + } /* if we got here and decided that the files are modified, but we * haven't calculated the OID of the new item, then calculate it now */ if (modified_uncertain && git_oid_iszero(&nitem->id)) { - if (git_oid_iszero(&noid)) { - const git_oid *update_check = - DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) ? - &oitem->id : NULL; + const git_oid *update_check = + DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) && omode == nmode ? + &oitem->id : NULL; - if ((error = git_diff__oid_for_entry( - &noid, diff, nitem, update_check)) < 0) - return error; - } + if ((error = git_diff__oid_for_entry( + &noid, diff, nitem, nmode, update_check)) < 0) + return error; /* if oid matches, then mark unmodified (except submodules, where * the filesystem content may be modified even if the oid still @@ -825,6 +875,20 @@ status = GIT_DELTA_UNMODIFIED; } + /* If we want case changes, then break this into a delete of the old + * and an add of the new so that consumers can act accordingly (eg, + * checkout will update the case on disk.) + */ + if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_IGNORE_CASE) && + DIFF_FLAG_IS_SET(diff, GIT_DIFF_INCLUDE_CASECHANGE) && + strcmp(oitem->path, nitem->path) != 0) { + + if (!(error = diff_delta__from_one(diff, GIT_DELTA_DELETED, oitem, NULL))) + error = diff_delta__from_one(diff, GIT_DELTA_ADDED, NULL, nitem); + + return error; + } + return diff_delta__from_two( diff, status, oitem, omode, nitem, nmode, git_oid_iszero(&noid) ? NULL : &noid, matched_pathspec); @@ -847,6 +911,84 @@ item->path[pathlen] == '/'); } +static int iterator_current( + const git_index_entry **entry, + git_iterator *iterator) +{ + int error; + + if ((error = git_iterator_current(entry, iterator)) == GIT_ITEROVER) { + *entry = NULL; + error = 0; + } + + return error; +} + +static int iterator_advance( + const git_index_entry **entry, + git_iterator *iterator) +{ + const git_index_entry *prev_entry = *entry; + int cmp, error; + + /* if we're looking for conflicts, we only want to report + * one conflict for each file, instead of all three sides. + * so if this entry is a conflict for this file, and the + * previous one was a conflict for the same file, skip it. + */ + while ((error = git_iterator_advance(entry, iterator)) == 0) { + if (!(iterator->flags & GIT_ITERATOR_INCLUDE_CONFLICTS) || + !git_index_entry_is_conflict(prev_entry) || + !git_index_entry_is_conflict(*entry)) + break; + + cmp = (iterator->flags & GIT_ITERATOR_IGNORE_CASE) ? + strcasecmp(prev_entry->path, (*entry)->path) : + strcmp(prev_entry->path, (*entry)->path); + + if (cmp) + break; + } + + if (error == GIT_ITEROVER) { + *entry = NULL; + error = 0; + } + + return error; +} + +static int iterator_advance_into( + const git_index_entry **entry, + git_iterator *iterator) +{ + int error; + + if ((error = git_iterator_advance_into(entry, iterator)) == GIT_ITEROVER) { + *entry = NULL; + error = 0; + } + + return error; +} + +static int iterator_advance_over_with_status( + const git_index_entry **entry, + git_iterator_status_t *status, + git_iterator *iterator) +{ + int error; + + if ((error = git_iterator_advance_over_with_status( + entry, status, iterator)) == GIT_ITEROVER) { + *entry = NULL; + error = 0; + } + + return error; +} + static int handle_unmatched_new_item( git_diff *diff, diff_in_progress *info) { @@ -858,8 +1000,12 @@ /* check if this is a prefix of the other side */ contains_oitem = entry_is_prefixed(diff, info->oitem, nitem); + /* update delta_type if this item is conflicted */ + if (git_index_entry_is_conflict(nitem)) + delta_type = GIT_DELTA_CONFLICTED; + /* update delta_type if this item is ignored */ - if (git_iterator_current_is_ignored(info->new_iter)) + else if (git_iterator_current_is_ignored(info->new_iter)) delta_type = GIT_DELTA_IGNORED; if (nitem->mode == GIT_FILEMODE_TREE) { @@ -894,18 +1040,17 @@ git_iterator_status_t untracked_state; /* attempt to insert record for this directory */ - if ((error = diff_delta__from_one(diff, delta_type, nitem)) != 0) + if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0) return error; /* if delta wasn't created (because of rules), just skip ahead */ last = diff_delta__last_for_item(diff, nitem); if (!last) - return git_iterator_advance(&info->nitem, info->new_iter); + return iterator_advance(&info->nitem, info->new_iter); /* iterate into dir looking for an actual untracked file */ - if ((error = git_iterator_advance_over_with_status( - &info->nitem, &untracked_state, info->new_iter)) < 0 && - error != GIT_ITEROVER) + if ((error = iterator_advance_over_with_status( + &info->nitem, &untracked_state, info->new_iter)) < 0) return error; /* if we found nothing or just ignored items, update the record */ @@ -925,7 +1070,7 @@ /* try to advance into directory if necessary */ if (recurse_into_dir) { - error = git_iterator_advance_into(&info->nitem, info->new_iter); + error = iterator_advance_into(&info->nitem, info->new_iter); /* if real error or no error, proceed with iteration */ if (error != GIT_ENOTFOUND) @@ -936,7 +1081,7 @@ * it or ignore it */ if (contains_oitem) - return git_iterator_advance(&info->nitem, info->new_iter); + return iterator_advance(&info->nitem, info->new_iter); delta_type = GIT_DELTA_IGNORED; } } @@ -945,10 +1090,12 @@ DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_RECURSE_IGNORED_DIRS) && git_iterator_current_tree_is_ignored(info->new_iter)) /* item contained in ignored directory, so skip over it */ - return git_iterator_advance(&info->nitem, info->new_iter); + return iterator_advance(&info->nitem, info->new_iter); - else if (info->new_iter->type != GIT_ITERATOR_TYPE_WORKDIR) - delta_type = GIT_DELTA_ADDED; + else if (info->new_iter->type != GIT_ITERATOR_TYPE_WORKDIR) { + if (delta_type != GIT_DELTA_CONFLICTED) + delta_type = GIT_DELTA_ADDED; + } else if (nitem->mode == GIT_FILEMODE_COMMIT) { /* ignore things that are not actual submodules */ @@ -958,12 +1105,12 @@ /* if this contains a tracked item, treat as normal TREE */ if (contains_oitem) { - error = git_iterator_advance_into(&info->nitem, info->new_iter); + error = iterator_advance_into(&info->nitem, info->new_iter); if (error != GIT_ENOTFOUND) return error; giterr_clear(); - return git_iterator_advance(&info->nitem, info->new_iter); + return iterator_advance(&info->nitem, info->new_iter); } } } @@ -976,7 +1123,7 @@ } /* Actually create the record for this item if necessary */ - if ((error = diff_delta__from_one(diff, delta_type, nitem)) != 0) + if ((error = diff_delta__from_one(diff, delta_type, NULL, nitem)) != 0) return error; /* If user requested TYPECHANGE records, then check for that instead of @@ -994,14 +1141,20 @@ } } - return git_iterator_advance(&info->nitem, info->new_iter); + return iterator_advance(&info->nitem, info->new_iter); } static int handle_unmatched_old_item( git_diff *diff, diff_in_progress *info) { - int error = diff_delta__from_one(diff, GIT_DELTA_DELETED, info->oitem); - if (error != 0) + git_delta_t delta_type = GIT_DELTA_DELETED; + int error; + + /* update delta_type if this item is conflicted */ + if (git_index_entry_is_conflict(info->oitem)) + delta_type = GIT_DELTA_CONFLICTED; + + if ((error = diff_delta__from_one(diff, delta_type, info->oitem, NULL)) < 0) return error; /* if we are generating TYPECHANGE records then check for that @@ -1023,10 +1176,10 @@ */ if (S_ISDIR(info->nitem->mode) && DIFF_FLAG_ISNT_SET(diff, GIT_DIFF_RECURSE_UNTRACKED_DIRS)) - return git_iterator_advance(&info->nitem, info->new_iter); + return iterator_advance(&info->nitem, info->new_iter); } - return git_iterator_advance(&info->oitem, info->old_iter); + return iterator_advance(&info->oitem, info->old_iter); } static int handle_matched_item( @@ -1037,9 +1190,8 @@ if ((error = maybe_modified(diff, info)) < 0) return error; - if (!(error = git_iterator_advance(&info->oitem, info->old_iter)) || - error == GIT_ITEROVER) - error = git_iterator_advance(&info->nitem, info->new_iter); + if (!(error = iterator_advance(&info->oitem, info->old_iter))) + error = iterator_advance(&info->nitem, info->new_iter); return error; } @@ -1075,13 +1227,9 @@ if ((error = diff_list_apply_options(diff, opts)) < 0) goto cleanup; - if ((error = git_iterator_current(&info.oitem, old_iter)) < 0 && - error != GIT_ITEROVER) + if ((error = iterator_current(&info.oitem, old_iter)) < 0 || + (error = iterator_current(&info.nitem, new_iter)) < 0) goto cleanup; - if ((error = git_iterator_current(&info.nitem, new_iter)) < 0 && - error != GIT_ITEROVER) - goto cleanup; - error = 0; /* run iterators building diffs */ while (!error && (info.oitem || info.nitem)) { @@ -1103,10 +1251,6 @@ */ else error = handle_matched_item(diff, &info); - - /* because we are iterating over two lists, ignore ITEROVER */ - if (error == GIT_ITEROVER) - error = 0; } diff->perf.stat_calls += old_iter->stat_calls + new_iter->stat_calls; @@ -1176,6 +1320,8 @@ { int error = 0; bool index_ignore_case = false; + git_iterator_flag_t iflag = GIT_ITERATOR_DONT_IGNORE_CASE | + GIT_ITERATOR_INCLUDE_CONFLICTS; assert(diff && repo); @@ -1185,10 +1331,8 @@ index_ignore_case = index->ignore_case; DIFF_FROM_ITERATORS( - git_iterator_for_tree( - &a, old_tree, GIT_ITERATOR_DONT_IGNORE_CASE, pfx, pfx), - git_iterator_for_index( - &b, index, GIT_ITERATOR_DONT_IGNORE_CASE, pfx, pfx) + git_iterator_for_tree(&a, old_tree, iflag, pfx, pfx), + git_iterator_for_index(&b, index, iflag, pfx, pfx) ); /* if index is in case-insensitive order, re-sort deltas to match */ @@ -1212,12 +1356,13 @@ return error; DIFF_FROM_ITERATORS( - git_iterator_for_index(&a, index, 0, pfx, pfx), + git_iterator_for_index( + &a, index, GIT_ITERATOR_INCLUDE_CONFLICTS, pfx, pfx), git_iterator_for_workdir( &b, repo, index, NULL, GIT_ITERATOR_DONT_AUTOEXPAND, pfx, pfx) ); - if (!error && DIFF_FLAG_IS_SET(*diff, GIT_DIFF_UPDATE_INDEX)) + if (!error && DIFF_FLAG_IS_SET(*diff, GIT_DIFF_UPDATE_INDEX) && (*diff)->index_updated) error = git_index_write(index); return error; @@ -1527,6 +1672,7 @@ char *summary = NULL, *loc = NULL; bool ignore_marker; unsigned int format_flags = 0; + size_t allocsize; int error; assert(out && diff && opts); @@ -1558,8 +1704,10 @@ goto on_error; } - summary = git__calloc(offset + 1, sizeof(char)); + GITERR_CHECK_ALLOC_ADD(&allocsize, offset, 1); + summary = git__calloc(allocsize, sizeof(char)); GITERR_CHECK_ALLOC(summary); + strncpy(summary, opts->summary, offset); } diff -Nru libgit2-0.22.2/src/diff_driver.c libgit2-0.23.1/src/diff_driver.c --- libgit2-0.22.2/src/diff_driver.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_driver.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,7 +17,7 @@ #include "config.h" #include "repository.h" -GIT__USE_STRMAP; +GIT__USE_STRMAP typedef enum { DIFF_DRIVER_AUTO = 0, @@ -116,7 +116,7 @@ if (error < 0) break; - if ((error = regcomp(&pat->re, buf.ptr, regex_flags)) < 0) { + if ((error = regcomp(&pat->re, buf.ptr, regex_flags)) != 0) { /* if regex fails to compile, warn? fail? */ error = giterr_set_regex(&pat->re, error); regfree(&pat->re); @@ -158,6 +158,30 @@ return repo->diff_drivers; } +static int diff_driver_alloc( + git_diff_driver **out, size_t *namelen_out, const char *name) +{ + git_diff_driver *driver; + size_t driverlen = sizeof(git_diff_driver), + namelen = strlen(name), + alloclen; + + GITERR_CHECK_ALLOC_ADD(&alloclen, driverlen, namelen); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + + driver = git__calloc(1, alloclen); + GITERR_CHECK_ALLOC(driver); + + memcpy(driver->name, name, namelen); + + *out = driver; + + if (namelen_out) + *namelen_out = namelen; + + return 0; +} + static int git_diff_driver_builtin( git_diff_driver **out, git_diff_driver_registry *reg, @@ -166,7 +190,7 @@ int error = 0; git_diff_driver_definition *ddef = NULL; git_diff_driver *drv = NULL; - size_t namelen, idx; + size_t idx; for (idx = 0; idx < ARRAY_SIZE(builtin_defs); ++idx) { if (!strcasecmp(driver_name, builtin_defs[idx].name)) { @@ -177,13 +201,10 @@ if (!ddef) goto done; - namelen = strlen(ddef->name); - - drv = git__calloc(1, sizeof(git_diff_driver) + namelen + 1); - GITERR_CHECK_ALLOC(drv); + if ((error = diff_driver_alloc(&drv, NULL, ddef->name)) < 0) + goto done; drv->type = DIFF_DRIVER_PATTERNLIST; - memcpy(drv->name, ddef->name, namelen); if (ddef->fns && (error = diff_driver_add_patterns( @@ -217,11 +238,11 @@ int error = 0; git_diff_driver_registry *reg; git_diff_driver *drv = NULL; - size_t namelen = strlen(driver_name); + size_t namelen; khiter_t pos; - git_config *cfg; + git_config *cfg = NULL; git_buf name = GIT_BUF_INIT; - const git_config_entry *ce; + git_config_entry *ce = NULL; bool found_driver = false; if ((reg = git_repository_driver_registry(repo)) == NULL) @@ -233,10 +254,10 @@ return 0; } - drv = git__calloc(1, sizeof(git_diff_driver) + namelen + 1); - GITERR_CHECK_ALLOC(drv); + if ((error = diff_driver_alloc(&drv, &namelen, driver_name)) < 0) + goto done; + drv->type = DIFF_DRIVER_AUTO; - memcpy(drv->name, driver_name, namelen); /* if you can't read config for repo, just use default driver */ if (git_repository_config_snapshot(&cfg, repo) < 0) { @@ -320,6 +341,7 @@ *out = drv; done: + git_config_entry_free(ce); git_buf_free(&name); git_config_free(cfg); @@ -397,14 +419,13 @@ int git_diff_driver_content_is_binary( git_diff_driver *driver, const char *content, size_t content_len) { - git_buf search; - - search.ptr = (char *)content; - search.size = min(content_len, GIT_FILTER_BYTES_TO_CHECK_NUL); - search.asize = 0; + git_buf search = GIT_BUF_INIT; GIT_UNUSED(driver); + git_buf_attach_notowned(&search, content, + min(content_len, GIT_FILTER_BYTES_TO_CHECK_NUL)); + /* TODO: provide encoding / binary detection callbacks that can * be UTF-8 aware, etc. For now, instead of trying to be smart, * let's just use the simple NUL-byte detection that core git uses. diff -Nru libgit2-0.22.2/src/diff_file.c libgit2-0.23.1/src/diff_file.c --- libgit2-0.22.2/src/diff_file.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_file.c 2015-08-03 18:07:35.000000000 +0000 @@ -89,10 +89,9 @@ int git_diff_file_content__init_from_diff( git_diff_file_content *fc, git_diff *diff, - size_t delta_index, + git_diff_delta *delta, bool use_old) { - git_diff_delta *delta = git_vector_get(&diff->deltas, delta_index); bool has_data = true; memset(fc, 0, sizeof(*fc)); @@ -187,7 +186,7 @@ return error; } - if ((error = git_submodule_status(&sm_status, sm)) < 0) { + if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0) { git_submodule_free(sm); return error; } @@ -218,7 +217,9 @@ return 0; } -static int diff_file_content_load_blob(git_diff_file_content *fc) +static int diff_file_content_load_blob( + git_diff_file_content *fc, + git_diff_options *opts) { int error = 0; git_odb_object *odb_obj = NULL; @@ -236,7 +237,8 @@ return error; } - if (diff_file_content_binary_by_size(fc)) + if ((opts->flags & GIT_DIFF_SHOW_BINARY) == 0 && + diff_file_content_binary_by_size(fc)) return 0; if (odb_obj != NULL) { @@ -283,7 +285,9 @@ } static int diff_file_content_load_workdir_file( - git_diff_file_content *fc, git_buf *path) + git_diff_file_content *fc, + git_buf *path, + git_diff_options *diff_opts) { int error = 0; git_filter_list *fl = NULL; @@ -297,12 +301,13 @@ !(fc->file->size = git_futils_filesize(fd))) goto cleanup; - if (diff_file_content_binary_by_size(fc)) + if ((diff_opts->flags & GIT_DIFF_SHOW_BINARY) == 0 && + diff_file_content_binary_by_size(fc)) goto cleanup; if ((error = git_filter_list_load( &fl, fc->repo, NULL, fc->file->path, - GIT_FILTER_TO_ODB, GIT_FILTER_OPT_ALLOW_UNSAFE)) < 0) + GIT_FILTER_TO_ODB, GIT_FILTER_ALLOW_UNSAFE)) < 0) goto cleanup; /* if there are no filters, try to mmap the file */ @@ -339,7 +344,9 @@ return error; } -static int diff_file_content_load_workdir(git_diff_file_content *fc) +static int diff_file_content_load_workdir( + git_diff_file_content *fc, + git_diff_options *diff_opts) { int error = 0; git_buf path = GIT_BUF_INIT; @@ -357,7 +364,7 @@ if (S_ISLNK(fc->file->mode)) error = diff_file_content_load_workdir_symlink(fc, &path); else - error = diff_file_content_load_workdir_file(fc, &path); + error = diff_file_content_load_workdir_file(fc, &path, diff_opts); /* once data is loaded, update OID if we didn't have it previously */ if (!error && (fc->file->flags & GIT_DIFF_FLAG_VALID_ID) == 0) { @@ -370,20 +377,23 @@ return error; } -int git_diff_file_content__load(git_diff_file_content *fc) +int git_diff_file_content__load( + git_diff_file_content *fc, + git_diff_options *diff_opts) { int error = 0; if ((fc->flags & GIT_DIFF_FLAG__LOADED) != 0) return 0; - if ((fc->file->flags & GIT_DIFF_FLAG_BINARY) != 0) + if ((fc->file->flags & GIT_DIFF_FLAG_BINARY) != 0 && + (diff_opts->flags & GIT_DIFF_SHOW_BINARY) == 0) return 0; if (fc->src == GIT_ITERATOR_TYPE_WORKDIR) - error = diff_file_content_load_workdir(fc); + error = diff_file_content_load_workdir(fc, diff_opts); else - error = diff_file_content_load_blob(fc); + error = diff_file_content_load_blob(fc, diff_opts); if (error) return error; diff -Nru libgit2-0.22.2/src/diff_file.h libgit2-0.23.1/src/diff_file.h --- libgit2-0.22.2/src/diff_file.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_file.h 2015-08-03 18:07:35.000000000 +0000 @@ -28,7 +28,7 @@ extern int git_diff_file_content__init_from_diff( git_diff_file_content *fc, git_diff *diff, - size_t delta_index, + git_diff_delta *delta, bool use_old); typedef struct { @@ -49,7 +49,9 @@ git_diff_file *as_file); /* this loads the blob/file-on-disk as needed */ -extern int git_diff_file_content__load(git_diff_file_content *fc); +extern int git_diff_file_content__load( + git_diff_file_content *fc, + git_diff_options *diff_opts); /* this releases the blob/file-in-memory */ extern void git_diff_file_content__unload(git_diff_file_content *fc); diff -Nru libgit2-0.22.2/src/diff.h libgit2-0.23.1/src/diff.h --- libgit2-0.22.2/src/diff.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff.h 2015-08-03 18:07:35.000000000 +0000 @@ -64,6 +64,7 @@ git_iterator_type_t new_src; uint32_t diffcaps; git_diff_perfdata perf; + bool index_updated; int (*strcomp)(const char *, const char *); int (*strncomp)(const char *, const char *, size_t); @@ -94,7 +95,7 @@ extern int git_diff__oid_for_file( git_oid *out, git_diff *, const char *, uint16_t, git_off_t); extern int git_diff__oid_for_entry( - git_oid *out, git_diff *, const git_index_entry *, const git_oid *update); + git_oid *out, git_diff *, const git_index_entry *, uint16_t, const git_oid *update); extern int git_diff__from_iterators( git_diff **diff_ptr, @@ -123,6 +124,25 @@ extern int git_diff__commit( git_diff **diff, git_repository *repo, const git_commit *commit, const git_diff_options *opts); +/* Merge two `git_diff`s according to the callback given by `cb`. */ + +typedef git_diff_delta *(*git_diff__merge_cb)( + const git_diff_delta *left, + const git_diff_delta *right, + git_pool *pool); + +extern int git_diff__merge( + git_diff *onto, const git_diff *from, git_diff__merge_cb cb); + +extern git_diff_delta *git_diff__merge_like_cgit( + const git_diff_delta *a, + const git_diff_delta *b, + git_pool *pool); + +/* Duplicate a `git_diff_delta` out of the `git_pool` */ +extern git_diff_delta *git_diff__delta_dup( + const git_diff_delta *d, git_pool *pool); + /* * Sometimes a git_diff_file will have a zero size; this attempts to * fill in the size without loading the blob if possible. If that is diff -Nru libgit2-0.22.2/src/diff_patch.c libgit2-0.23.1/src/diff_patch.c --- libgit2-0.22.2/src/diff_patch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_patch.c 2015-08-03 18:07:35.000000000 +0000 @@ -11,41 +11,13 @@ #include "diff_driver.h" #include "diff_patch.h" #include "diff_xdiff.h" +#include "delta.h" +#include "zstream.h" #include "fileops.h" -/* cached information about a hunk in a diff */ -typedef struct diff_patch_hunk { - git_diff_hunk hunk; - size_t line_start; - size_t line_count; -} diff_patch_hunk; - -struct git_patch { - git_refcount rc; - git_diff *diff; /* for refcount purposes, maybe NULL for blob diffs */ - git_diff_delta *delta; - size_t delta_index; - git_diff_file_content ofile; - git_diff_file_content nfile; - uint32_t flags; - git_array_t(diff_patch_hunk) hunks; - git_array_t(git_diff_line) lines; - size_t content_size, context_size, header_size; - git_pool flattened; -}; - -enum { - GIT_DIFF_PATCH_ALLOCATED = (1 << 0), - GIT_DIFF_PATCH_INITIALIZED = (1 << 1), - GIT_DIFF_PATCH_LOADED = (1 << 2), - GIT_DIFF_PATCH_DIFFABLE = (1 << 3), - GIT_DIFF_PATCH_DIFFED = (1 << 4), - GIT_DIFF_PATCH_FLATTENED = (1 << 5), -}; - static void diff_output_init( - git_diff_output*, const git_diff_options*, - git_diff_file_cb, git_diff_hunk_cb, git_diff_line_cb, void*); + git_diff_output*, const git_diff_options*, git_diff_file_cb, + git_diff_binary_cb, git_diff_hunk_cb, git_diff_line_cb, void*); static void diff_output_to_patch(git_diff_output *, git_patch *); @@ -67,15 +39,38 @@ { diff_patch_update_binary(patch); - if ((patch->delta->flags & GIT_DIFF_FLAG_BINARY) != 0) - patch->flags |= GIT_DIFF_PATCH_LOADED; /* LOADED but not DIFFABLE */ - patch->flags |= GIT_DIFF_PATCH_INITIALIZED; if (patch->diff) git_diff_addref(patch->diff); } +static int diff_patch_normalize_options( + git_diff_options *out, + const git_diff_options *opts) +{ + if (opts) { + GITERR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options"); + memcpy(out, opts, sizeof(git_diff_options)); + } else { + git_diff_options default_opts = GIT_DIFF_OPTIONS_INIT; + memcpy(out, &default_opts, sizeof(git_diff_options)); + } + + out->old_prefix = opts && opts->old_prefix ? + git__strdup(opts->old_prefix) : + git__strdup(DIFF_OLD_PREFIX_DEFAULT); + + out->new_prefix = opts && opts->new_prefix ? + git__strdup(opts->new_prefix) : + git__strdup(DIFF_NEW_PREFIX_DEFAULT); + + GITERR_CHECK_ALLOC(out->old_prefix); + GITERR_CHECK_ALLOC(out->new_prefix); + + return 0; +} + static int diff_patch_init_from_diff( git_patch *patch, git_diff *diff, size_t delta_index) { @@ -86,10 +81,12 @@ patch->delta = git_vector_get(&diff->deltas, delta_index); patch->delta_index = delta_index; - if ((error = git_diff_file_content__init_from_diff( - &patch->ofile, diff, delta_index, true)) < 0 || + if ((error = diff_patch_normalize_options( + &patch->diff_opts, &diff->opts)) < 0 || + (error = git_diff_file_content__init_from_diff( + &patch->ofile, diff, patch->delta, true)) < 0 || (error = git_diff_file_content__init_from_diff( - &patch->nfile, diff, delta_index, false)) < 0) + &patch->nfile, diff, patch->delta, false)) < 0) return error; diff_patch_init_common(patch); @@ -116,6 +113,43 @@ return error; } +GIT_INLINE(bool) should_skip_binary(git_patch *patch, git_diff_file *file) +{ + if ((patch->diff_opts.flags & GIT_DIFF_SHOW_BINARY) != 0) + return false; + + return (file->flags & GIT_DIFF_FLAG_BINARY) != 0; +} + +static bool diff_patch_diffable(git_patch *patch) +{ + size_t olen, nlen; + + if (patch->delta->status == GIT_DELTA_UNMODIFIED) + return false; + + /* if we've determined this to be binary (and we are not showing binary + * data) then we have skipped loading the map data. instead, query the + * file data itself. + */ + if ((patch->delta->flags & GIT_DIFF_FLAG_BINARY) != 0 && + (patch->diff_opts.flags & GIT_DIFF_SHOW_BINARY) == 0) { + olen = (size_t)patch->ofile.file->size; + nlen = (size_t)patch->nfile.file->size; + } else { + olen = patch->ofile.map.len; + nlen = patch->nfile.map.len; + } + + /* if both sides are empty, files are identical */ + if (!olen && !nlen) + return false; + + /* otherwise, check the file sizes and the oid */ + return (olen != nlen || + !git_oid_equal(&patch->ofile.file->id, &patch->nfile.file->id)); +} + static int diff_patch_load(git_patch *patch, git_diff_output *output) { int error = 0; @@ -128,7 +162,7 @@ * binary, then there is no need to actually load the data */ if ((patch->ofile.opts_flags & GIT_DIFF_SKIP_BINARY_CHECK) != 0 && - output && !output->hunk_cb && !output->data_cb) + output && !output->binary_cb && !output->hunk_cb && !output->data_cb) return 0; incomplete_data = @@ -141,25 +175,29 @@ * need 2x data size and this minimizes peak memory footprint */ if (patch->ofile.src == GIT_ITERATOR_TYPE_WORKDIR) { - if ((error = git_diff_file_content__load(&patch->ofile)) < 0 || - (patch->ofile.file->flags & GIT_DIFF_FLAG_BINARY) != 0) + if ((error = git_diff_file_content__load( + &patch->ofile, &patch->diff_opts)) < 0 || + should_skip_binary(patch, patch->ofile.file)) goto cleanup; } if (patch->nfile.src == GIT_ITERATOR_TYPE_WORKDIR) { - if ((error = git_diff_file_content__load(&patch->nfile)) < 0 || - (patch->nfile.file->flags & GIT_DIFF_FLAG_BINARY) != 0) + if ((error = git_diff_file_content__load( + &patch->nfile, &patch->diff_opts)) < 0 || + should_skip_binary(patch, patch->nfile.file)) goto cleanup; } /* once workdir has been tried, load other data as needed */ if (patch->ofile.src != GIT_ITERATOR_TYPE_WORKDIR) { - if ((error = git_diff_file_content__load(&patch->ofile)) < 0 || - (patch->ofile.file->flags & GIT_DIFF_FLAG_BINARY) != 0) + if ((error = git_diff_file_content__load( + &patch->ofile, &patch->diff_opts)) < 0 || + should_skip_binary(patch, patch->ofile.file)) goto cleanup; } if (patch->nfile.src != GIT_ITERATOR_TYPE_WORKDIR) { - if ((error = git_diff_file_content__load(&patch->nfile)) < 0 || - (patch->nfile.file->flags & GIT_DIFF_FLAG_BINARY) != 0) + if ((error = git_diff_file_content__load( + &patch->nfile, &patch->diff_opts)) < 0 || + should_skip_binary(patch, patch->nfile.file)) goto cleanup; } @@ -177,14 +215,7 @@ diff_patch_update_binary(patch); if (!error) { - /* patch is diffable only for non-binary, modified files where - * at least one side has data and the data actually changed - */ - if ((patch->delta->flags & GIT_DIFF_FLAG_BINARY) == 0 && - patch->delta->status != GIT_DELTA_UNMODIFIED && - (patch->ofile.map.len || patch->nfile.map.len) && - (patch->ofile.map.len != patch->nfile.map.len || - !git_oid_equal(&patch->ofile.file->id, &patch->nfile.file->id))) + if (diff_patch_diffable(patch)) patch->flags |= GIT_DIFF_PATCH_DIFFABLE; patch->flags |= GIT_DIFF_PATCH_LOADED; @@ -207,6 +238,103 @@ "git_patch"); } +static int create_binary( + git_diff_binary_t *out_type, + char **out_data, + size_t *out_datalen, + size_t *out_inflatedlen, + const char *a_data, + size_t a_datalen, + const char *b_data, + size_t b_datalen) +{ + git_buf deflate = GIT_BUF_INIT, delta = GIT_BUF_INIT; + unsigned long delta_data_len; + int error; + + /* The git_delta function accepts unsigned long only */ + if (!git__is_ulong(a_datalen) || !git__is_ulong(b_datalen)) + return GIT_EBUFS; + + if ((error = git_zstream_deflatebuf(&deflate, b_data, b_datalen)) < 0) + goto done; + + /* The git_delta function accepts unsigned long only */ + if (!git__is_ulong(deflate.size)) { + error = GIT_EBUFS; + goto done; + } + + if (a_datalen && b_datalen) { + void *delta_data = git_delta( + a_data, (unsigned long)a_datalen, + b_data, (unsigned long)b_datalen, + &delta_data_len, (unsigned long)deflate.size); + + if (delta_data) { + error = git_zstream_deflatebuf( + &delta, delta_data, (size_t)delta_data_len); + + git__free(delta_data); + + if (error < 0) + goto done; + } + } + + if (delta.size && delta.size < deflate.size) { + *out_type = GIT_DIFF_BINARY_DELTA; + *out_datalen = delta.size; + *out_data = git_buf_detach(&delta); + *out_inflatedlen = delta_data_len; + } else { + *out_type = GIT_DIFF_BINARY_LITERAL; + *out_datalen = deflate.size; + *out_data = git_buf_detach(&deflate); + *out_inflatedlen = b_datalen; + } + +done: + git_buf_free(&deflate); + git_buf_free(&delta); + + return error; +} + +static int diff_binary(git_diff_output *output, git_patch *patch) +{ + git_diff_binary binary = {{0}}; + const char *old_data = patch->ofile.map.data; + const char *new_data = patch->nfile.map.data; + size_t old_len = patch->ofile.map.len, + new_len = patch->nfile.map.len; + int error; + + /* Create the old->new delta (as the "new" side of the patch), + * and the new->old delta (as the "old" side) + */ + if ((error = create_binary(&binary.old_file.type, + (char **)&binary.old_file.data, + &binary.old_file.datalen, + &binary.old_file.inflatedlen, + new_data, new_len, old_data, old_len)) < 0 || + (error = create_binary(&binary.new_file.type, + (char **)&binary.new_file.data, + &binary.new_file.datalen, + &binary.new_file.inflatedlen, + old_data, old_len, new_data, new_len)) < 0) + return error; + + error = giterr_set_after_callback_function( + output->binary_cb(patch->delta, &binary, output->payload), + "git_patch"); + + git__free((char *) binary.old_file.data); + git__free((char *) binary.new_file.data); + + return error; +} + static int diff_patch_generate(git_patch *patch, git_diff_output *output) { int error = 0; @@ -214,8 +342,8 @@ if ((patch->flags & GIT_DIFF_PATCH_DIFFED) != 0) return 0; - /* if we are not looking at the hunks and lines, don't do the diff */ - if (!output->hunk_cb && !output->data_cb) + /* if we are not looking at the binary or text data, don't do the diff */ + if (!output->binary_cb && !output->hunk_cb && !output->data_cb) return 0; if ((patch->flags & GIT_DIFF_PATCH_LOADED) == 0 && @@ -225,10 +353,16 @@ if ((patch->flags & GIT_DIFF_PATCH_DIFFABLE) == 0) return 0; - if (output->diff_cb != NULL && - (error = output->diff_cb(output, patch)) < 0) - patch->flags |= GIT_DIFF_PATCH_DIFFED; + if ((patch->delta->flags & GIT_DIFF_FLAG_BINARY) != 0) { + if (output->binary_cb) + error = diff_binary(output, patch); + } + else { + if (output->diff_cb) + error = output->diff_cb(output, patch); + } + patch->flags |= GIT_DIFF_PATCH_DIFFED; return error; } @@ -245,6 +379,12 @@ git_pool_clear(&patch->flattened); + git__free((char *)patch->diff_opts.old_prefix); + git__free((char *)patch->diff_opts.new_prefix); + + git__free((char *)patch->binary.old_file.data); + git__free((char *)patch->binary.new_file.data); + if (patch->flags & GIT_DIFF_PATCH_ALLOCATED) git__free(patch); } @@ -260,6 +400,7 @@ int git_diff_foreach( git_diff *diff, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb data_cb, void *payload) @@ -275,7 +416,7 @@ memset(&xo, 0, sizeof(xo)); memset(&patch, 0, sizeof(patch)); diff_output_init( - &xo.output, &diff->opts, file_cb, hunk_cb, data_cb, payload); + &xo.output, &diff->opts, file_cb, binary_cb, hunk_cb, data_cb, payload); git_xdiff_init(&xo, &diff->opts); git_vector_foreach(&diff->deltas, idx, patch.delta) { @@ -284,11 +425,16 @@ if (git_diff_delta__should_skip(&diff->opts, patch.delta)) continue; - if ((error = diff_patch_init_from_diff(&patch, diff, idx)) < 0) - break; + if (binary_cb || hunk_cb || data_cb) { + if ((error = diff_patch_init_from_diff(&patch, diff, idx)) != 0 || + (error = diff_patch_load(&patch, &xo.output)) != 0) + return error; + } - if (!(error = diff_patch_invoke_file_callback(&patch, &xo.output))) - error = diff_patch_generate(&patch, &xo.output); + if ((error = diff_patch_invoke_file_callback(&patch, &xo.output)) == 0) { + if (binary_cb || hunk_cb || data_cb) + error = diff_patch_generate(&patch, &xo.output); + } git_patch_free(&patch); @@ -349,7 +495,8 @@ git_diff_file *lfile = &pd->delta.old_file, *rfile = &pd->delta.new_file; git_diff_file_content *ldata = &pd->patch.ofile, *rdata = &pd->patch.nfile; - GITERR_CHECK_VERSION(opts, GIT_DIFF_OPTIONS_VERSION, "git_diff_options"); + if ((error = diff_patch_normalize_options(&pd->patch.diff_opts, opts)) < 0) + return error; if (opts && (opts->flags & GIT_DIFF_REVERSE) != 0) { void *tmp = lfile; lfile = rfile; rfile = tmp; @@ -387,8 +534,13 @@ diff_patch_with_delta *pd; size_t old_len = *old_path ? strlen(*old_path) : 0; size_t new_len = *new_path ? strlen(*new_path) : 0; + size_t alloc_len; + + GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*pd), old_len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, new_len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2); - *out = pd = git__calloc(1, sizeof(*pd) + old_len + new_len + 2); + *out = pd = git__calloc(1, alloc_len); GITERR_CHECK_ALLOC(pd); pd->patch.flags = GIT_DIFF_PATCH_ALLOCATED; @@ -413,6 +565,7 @@ git_diff_file_content_src *newsrc, const git_diff_options *opts, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb data_cb, void *payload) @@ -423,7 +576,7 @@ memset(&xo, 0, sizeof(xo)); diff_output_init( - &xo.output, opts, file_cb, hunk_cb, data_cb, payload); + &xo.output, opts, file_cb, binary_cb, hunk_cb, data_cb, payload); git_xdiff_init(&xo, opts); memset(&pd, 0, sizeof(pd)); @@ -471,6 +624,7 @@ const char *new_path, const git_diff_options *opts, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb data_cb, void *payload) @@ -480,7 +634,7 @@ git_diff_file_content_src nsrc = GIT_DIFF_FILE_CONTENT_SRC__BLOB(new_blob, new_path); return diff_from_sources( - &osrc, &nsrc, opts, file_cb, hunk_cb, data_cb, payload); + &osrc, &nsrc, opts, file_cb, binary_cb, hunk_cb, data_cb, payload); } int git_patch_from_blobs( @@ -506,6 +660,7 @@ const char *buf_path, const git_diff_options *opts, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb data_cb, void *payload) @@ -515,7 +670,7 @@ git_diff_file_content_src nsrc = GIT_DIFF_FILE_CONTENT_SRC__BUF(buf, buflen, buf_path); return diff_from_sources( - &osrc, &nsrc, opts, file_cb, hunk_cb, data_cb, payload); + &osrc, &nsrc, opts, file_cb, binary_cb, hunk_cb, data_cb, payload); } int git_patch_from_blob_and_buffer( @@ -543,6 +698,7 @@ const char *new_path, const git_diff_options *opts, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb data_cb, void *payload) @@ -552,7 +708,7 @@ git_diff_file_content_src nsrc = GIT_DIFF_FILE_CONTENT_SRC__BUF(new_buf, new_len, new_path); return diff_from_sources( - &osrc, &nsrc, opts, file_cb, hunk_cb, data_cb, payload); + &osrc, &nsrc, opts, file_cb, binary_cb, hunk_cb, data_cb, payload); } int git_patch_from_buffers( @@ -806,6 +962,7 @@ int git_patch__invoke_callbacks( git_patch *patch, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload) @@ -816,6 +973,13 @@ if (file_cb) error = file_cb(patch->delta, 0, payload); + if ((patch->delta->flags & GIT_DIFF_FLAG_BINARY) != 0) { + if (binary_cb) + error = binary_cb(patch->delta, &patch->binary, payload); + + return error; + } + if (!hunk_cb && !line_cb) return error; @@ -849,6 +1013,36 @@ return 0; } +static int diff_patch_binary_cb( + const git_diff_delta *delta, + const git_diff_binary *binary, + void *payload) +{ + git_patch *patch = payload; + + GIT_UNUSED(delta); + + memcpy(&patch->binary, binary, sizeof(git_diff_binary)); + + if (binary->old_file.data) { + patch->binary.old_file.data = git__malloc(binary->old_file.datalen); + GITERR_CHECK_ALLOC(patch->binary.old_file.data); + + memcpy((char *)patch->binary.old_file.data, + binary->old_file.data, binary->old_file.datalen); + } + + if (binary->new_file.data) { + patch->binary.new_file.data = git__malloc(binary->new_file.datalen); + GITERR_CHECK_ALLOC(patch->binary.new_file.data); + + memcpy((char *)patch->binary.new_file.data, + binary->new_file.data, binary->new_file.datalen); + } + + return 0; +} + static int diff_patch_hunk_cb( const git_diff_delta *delta, const git_diff_hunk *hunk_, @@ -915,6 +1109,7 @@ git_diff_output *out, const git_diff_options *opts, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb data_cb, void *payload) @@ -924,6 +1119,7 @@ memset(out, 0, sizeof(*out)); out->file_cb = file_cb; + out->binary_cb = binary_cb; out->hunk_cb = hunk_cb; out->data_cb = data_cb; out->payload = payload; @@ -932,6 +1128,11 @@ static void diff_output_to_patch(git_diff_output *out, git_patch *patch) { diff_output_init( - out, NULL, - diff_patch_file_cb, diff_patch_hunk_cb, diff_patch_line_cb, patch); + out, + NULL, + diff_patch_file_cb, + diff_patch_binary_cb, + diff_patch_hunk_cb, + diff_patch_line_cb, + patch); } diff -Nru libgit2-0.22.2/src/diff_patch.h libgit2-0.23.1/src/diff_patch.h --- libgit2-0.22.2/src/diff_patch.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_patch.h 2015-08-03 18:07:35.000000000 +0000 @@ -13,6 +13,40 @@ #include "array.h" #include "git2/patch.h" + /* cached information about a hunk in a diff */ +typedef struct diff_patch_hunk { + git_diff_hunk hunk; + size_t line_start; + size_t line_count; +} diff_patch_hunk; + +enum { + GIT_DIFF_PATCH_ALLOCATED = (1 << 0), + GIT_DIFF_PATCH_INITIALIZED = (1 << 1), + GIT_DIFF_PATCH_LOADED = (1 << 2), + /* the two sides are different */ + GIT_DIFF_PATCH_DIFFABLE = (1 << 3), + /* the difference between the two sides has been computed */ + GIT_DIFF_PATCH_DIFFED = (1 << 4), + GIT_DIFF_PATCH_FLATTENED = (1 << 5), +}; + +struct git_patch { + git_refcount rc; + git_diff *diff; /* for refcount purposes, maybe NULL for blob diffs */ + git_diff_options diff_opts; + git_diff_delta *delta; + size_t delta_index; + git_diff_file_content ofile; + git_diff_file_content nfile; + uint32_t flags; + git_diff_binary binary; + git_array_t(diff_patch_hunk) hunks; + git_array_t(git_diff_line) lines; + size_t content_size, context_size, header_size; + git_pool flattened; +}; + extern git_diff *git_patch__diff(git_patch *); extern git_diff_driver *git_patch__driver(git_patch *); @@ -23,6 +57,7 @@ extern int git_patch__invoke_callbacks( git_patch *patch, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *payload); @@ -31,6 +66,7 @@ struct git_diff_output { /* these callbacks are issued with the diff data */ git_diff_file_cb file_cb; + git_diff_binary_cb binary_cb; git_diff_hunk_cb hunk_cb; git_diff_line_cb data_cb; void *payload; diff -Nru libgit2-0.22.2/src/diff_print.c libgit2-0.23.1/src/diff_print.c --- libgit2-0.22.2/src/diff_print.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_print.c 2015-08-03 18:07:35.000000000 +0000 @@ -22,50 +22,92 @@ uint32_t flags; int oid_strlen; git_diff_line line; + unsigned int + content_loaded : 1, + content_allocated : 1; + git_diff_file_content *ofile; + git_diff_file_content *nfile; } diff_print_info; -static int diff_print_info_init( +static int diff_print_info_init__common( diff_print_info *pi, git_buf *out, - git_diff *diff, + git_repository *repo, git_diff_format_t format, git_diff_line_cb cb, void *payload) { - pi->diff = diff; - pi->format = format; + pi->format = format; pi->print_cb = cb; - pi->payload = payload; - pi->buf = out; - - if (diff) - pi->flags = diff->opts.flags; - else - pi->flags = 0; + pi->payload = payload; + pi->buf = out; - if (diff && diff->opts.id_abbrev != 0) - pi->oid_strlen = diff->opts.id_abbrev; - else if (!diff || !diff->repo) - pi->oid_strlen = GIT_ABBREV_DEFAULT; - else if (git_repository__cvar( - &pi->oid_strlen, diff->repo, GIT_CVAR_ABBREV) < 0) - return -1; + if (!pi->oid_strlen) { + if (!repo) + pi->oid_strlen = GIT_ABBREV_DEFAULT; + else if (git_repository__cvar(&pi->oid_strlen, repo, GIT_CVAR_ABBREV) < 0) + return -1; + } pi->oid_strlen += 1; /* for NUL byte */ - if (pi->oid_strlen < 2) - pi->oid_strlen = 2; - else if (pi->oid_strlen > GIT_OID_HEXSZ + 1) + if (pi->oid_strlen > GIT_OID_HEXSZ + 1) pi->oid_strlen = GIT_OID_HEXSZ + 1; memset(&pi->line, 0, sizeof(pi->line)); pi->line.old_lineno = -1; pi->line.new_lineno = -1; - pi->line.num_lines = 1; + pi->line.num_lines = 1; return 0; } +static int diff_print_info_init_fromdiff( + diff_print_info *pi, + git_buf *out, + git_diff *diff, + git_diff_format_t format, + git_diff_line_cb cb, + void *payload) +{ + git_repository *repo = diff ? diff->repo : NULL; + + memset(pi, 0, sizeof(diff_print_info)); + + pi->diff = diff; + + if (diff) { + pi->flags = diff->opts.flags; + pi->oid_strlen = diff->opts.id_abbrev; + } + + return diff_print_info_init__common(pi, out, repo, format, cb, payload); +} + +static int diff_print_info_init_frompatch( + diff_print_info *pi, + git_buf *out, + git_patch *patch, + git_diff_format_t format, + git_diff_line_cb cb, + void *payload) +{ + git_repository *repo = patch && patch->diff ? patch->diff->repo : NULL; + + memset(pi, 0, sizeof(diff_print_info)); + + pi->diff = patch->diff; + + pi->flags = patch->diff_opts.flags; + pi->oid_strlen = patch->diff_opts.id_abbrev; + + pi->content_loaded = 1; + pi->ofile = &patch->ofile; + pi->nfile = &patch->nfile; + + return diff_print_info_init__common(pi, out, repo, format, cb, payload); +} + static char diff_pick_suffix(int mode) { if (S_ISDIR(mode)) @@ -283,66 +325,21 @@ return git_buf_oom(out) ? -1 : 0; } -static int print_binary_hunk(diff_print_info *pi, git_blob *old, git_blob *new) -{ - git_buf deflate = GIT_BUF_INIT, delta = GIT_BUF_INIT, *out = NULL; - const void *old_data, *new_data; - git_off_t old_data_len, new_data_len; - unsigned long delta_data_len, inflated_len; - const char *out_type = "literal"; - char *scan, *end; - int error; - - old_data = old ? git_blob_rawcontent(old) : NULL; - new_data = new ? git_blob_rawcontent(new) : NULL; - - old_data_len = old ? git_blob_rawsize(old) : 0; - new_data_len = new ? git_blob_rawsize(new) : 0; - - /* The git_delta function accepts unsigned long only */ - if (!git__is_ulong(old_data_len) || !git__is_ulong(new_data_len)) - return GIT_EBUFS; - - out = &deflate; - inflated_len = (unsigned long)new_data_len; - - if ((error = git_zstream_deflatebuf( - out, new_data, (size_t)new_data_len)) < 0) - goto done; - - /* The git_delta function accepts unsigned long only */ - if (!git__is_ulong((git_off_t)deflate.size)) { - error = GIT_EBUFS; - goto done; - } - - if (old && new) { - void *delta_data = git_delta( - old_data, (unsigned long)old_data_len, - new_data, (unsigned long)new_data_len, - &delta_data_len, (unsigned long)deflate.size); - - if (delta_data) { - error = git_zstream_deflatebuf( - &delta, delta_data, (size_t)delta_data_len); - - git__free(delta_data); - - if (error < 0) - goto done; - - if (delta.size < deflate.size) { - out = δ - out_type = "delta"; - inflated_len = delta_data_len; - } - } - } +static int format_binary( + diff_print_info *pi, + git_diff_binary_t type, + const char *data, + size_t datalen, + size_t inflatedlen) +{ + const char *typename = type == GIT_DIFF_BINARY_DELTA ? + "delta" : "literal"; + const char *scan, *end; - git_buf_printf(pi->buf, "%s %lu\n", out_type, inflated_len); + git_buf_printf(pi->buf, "%s %" PRIuZ "\n", typename, inflatedlen); pi->line.num_lines++; - for (scan = out->ptr, end = out->ptr + out->size; scan < end; ) { + for (scan = data, end = data + datalen; scan < end; ) { size_t chunk_len = end - scan; if (chunk_len > 52) chunk_len = 52; @@ -355,51 +352,74 @@ git_buf_encode_base85(pi->buf, scan, chunk_len); git_buf_putc(pi->buf, '\n'); - if (git_buf_oom(pi->buf)) { - error = -1; - goto done; - } + if (git_buf_oom(pi->buf)) + return -1; scan += chunk_len; pi->line.num_lines++; } -done: - git_buf_free(&deflate); - git_buf_free(&delta); + return 0; +} - return error; +static int diff_print_load_content( + diff_print_info *pi, + git_diff_delta *delta) +{ + git_diff_file_content *ofile, *nfile; + int error; + + assert(pi->diff); + + ofile = git__calloc(1, sizeof(git_diff_file_content)); + nfile = git__calloc(1, sizeof(git_diff_file_content)); + + GITERR_CHECK_ALLOC(ofile); + GITERR_CHECK_ALLOC(nfile); + + if ((error = git_diff_file_content__init_from_diff( + ofile, pi->diff, delta, true)) < 0 || + (error = git_diff_file_content__init_from_diff( + nfile, pi->diff, delta, true)) < 0) { + + git__free(ofile); + git__free(nfile); + return error; + } + + pi->content_loaded = 1; + pi->content_allocated = 1; + pi->ofile = ofile; + pi->nfile = nfile; + + return 0; } -/* git diff --binary 8d7523f~2 8d7523f~1 */ static int diff_print_patch_file_binary( - diff_print_info *pi, const git_diff_delta *delta, - const char *oldpfx, const char *newpfx) + diff_print_info *pi, git_diff_delta *delta, + const char *old_pfx, const char *new_pfx, + const git_diff_binary *binary) { - git_blob *old = NULL, *new = NULL; - const git_oid *old_id, *new_id; - int error; size_t pre_binary_size; + int error; if ((pi->flags & GIT_DIFF_SHOW_BINARY) == 0) goto noshow; + if (!pi->content_loaded && + (error = diff_print_load_content(pi, delta)) < 0) + return error; + pre_binary_size = pi->buf->size; git_buf_printf(pi->buf, "GIT binary patch\n"); pi->line.num_lines++; - old_id = (delta->status != GIT_DELTA_ADDED) ? &delta->old_file.id : NULL; - new_id = (delta->status != GIT_DELTA_DELETED) ? &delta->new_file.id : NULL; - - if (old_id && (error = git_blob_lookup(&old, pi->diff->repo, old_id)) < 0) - goto done; - if (new_id && (error = git_blob_lookup(&new, pi->diff->repo,new_id)) < 0) - goto done; - - if ((error = print_binary_hunk(pi, old, new)) < 0 || + if ((error = format_binary(pi, binary->new_file.type, binary->new_file.data, + binary->new_file.datalen, binary->new_file.inflatedlen)) < 0 || (error = git_buf_putc(pi->buf, '\n')) < 0 || - (error = print_binary_hunk(pi, new, old)) < 0) - { + (error = format_binary(pi, binary->old_file.type, binary->old_file.data, + binary->old_file.datalen, binary->old_file.inflatedlen)) < 0) { + if (error == GIT_EBUFS) { giterr_clear(); git_buf_truncate(pi->buf, pre_binary_size); @@ -408,17 +428,12 @@ } pi->line.num_lines++; - -done: - git_blob_free(old); - git_blob_free(new); - return error; noshow: pi->line.num_lines = 1; return diff_delta_format_with_paths( - pi->buf, delta, oldpfx, newpfx, + pi->buf, delta, old_pfx, new_pfx, "Binary files %s%s and %s%s differ\n"); } @@ -432,7 +447,8 @@ const char *newpfx = pi->diff ? pi->diff->opts.new_prefix : DIFF_NEW_PREFIX_DEFAULT; - bool binary = !!(delta->flags & GIT_DIFF_FLAG_BINARY); + bool binary = (delta->flags & GIT_DIFF_FLAG_BINARY) || + (pi->flags & GIT_DIFF_FORCE_BINARY); bool show_binary = !!(pi->flags & GIT_DIFF_SHOW_BINARY); int oid_strlen = binary && show_binary ? GIT_OID_HEXSZ + 1 : pi->oid_strlen; @@ -455,19 +471,29 @@ pi->line.content = git_buf_cstr(pi->buf); pi->line.content_len = git_buf_len(pi->buf); - if ((error = pi->print_cb(delta, NULL, &pi->line, pi->payload)) != 0) - return error; + return pi->print_cb(delta, NULL, &pi->line, pi->payload); +} - if (!binary) - return 0; +static int diff_print_patch_binary( + const git_diff_delta *delta, + const git_diff_binary *binary, + void *data) +{ + diff_print_info *pi = data; + const char *old_pfx = + pi->diff ? pi->diff->opts.old_prefix : DIFF_OLD_PREFIX_DEFAULT; + const char *new_pfx = + pi->diff ? pi->diff->opts.new_prefix : DIFF_NEW_PREFIX_DEFAULT; + int error; git_buf_clear(pi->buf); - if ((error = diff_print_patch_file_binary(pi, delta, oldpfx, newpfx)) < 0) + if ((error = diff_print_patch_file_binary( + pi, (git_diff_delta *)delta, old_pfx, new_pfx, binary)) < 0) return error; - pi->line.origin = GIT_DIFF_LINE_BINARY; - pi->line.content = git_buf_cstr(pi->buf); + pi->line.origin = GIT_DIFF_LINE_BINARY; + pi->line.content = git_buf_cstr(pi->buf); pi->line.content_len = git_buf_len(pi->buf); return pi->print_cb(delta, NULL, &pi->line, pi->payload); @@ -515,12 +541,14 @@ git_buf buf = GIT_BUF_INIT; diff_print_info pi; git_diff_file_cb print_file = NULL; + git_diff_binary_cb print_binary = NULL; git_diff_hunk_cb print_hunk = NULL; git_diff_line_cb print_line = NULL; switch (format) { case GIT_DIFF_FORMAT_PATCH: print_file = diff_print_patch_file; + print_binary = diff_print_patch_binary; print_hunk = diff_print_patch_hunk; print_line = diff_print_patch_line; break; @@ -541,16 +569,18 @@ return -1; } - if (!(error = diff_print_info_init( - &pi, &buf, diff, format, print_cb, payload))) - { + if (!(error = diff_print_info_init_fromdiff( + &pi, &buf, diff, format, print_cb, payload))) { error = git_diff_foreach( - diff, print_file, print_hunk, print_line, &pi); + diff, print_file, print_binary, print_hunk, print_line, &pi); if (error) /* make sure error message is set */ giterr_set_after_callback_function(error, "git_diff_print"); } + git__free(pi.nfile); + git__free(pi.ofile); + git_buf_free(&buf); return error; @@ -568,13 +598,13 @@ assert(patch && print_cb); - if (!(error = diff_print_info_init( - &pi, &temp, git_patch__diff(patch), + if (!(error = diff_print_info_init_frompatch( + &pi, &temp, patch, GIT_DIFF_FORMAT_PATCH, print_cb, payload))) { error = git_patch__invoke_callbacks( - patch, diff_print_patch_file, diff_print_patch_hunk, - diff_print_patch_line, &pi); + patch, diff_print_patch_file, diff_print_patch_binary, + diff_print_patch_hunk, diff_print_patch_line, &pi); if (error) /* make sure error message is set */ giterr_set_after_callback_function(error, "git_patch_print"); diff -Nru libgit2-0.22.2/src/diff_tform.c libgit2-0.23.1/src/diff_tform.c --- libgit2-0.22.2/src/diff_tform.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/diff_tform.c 2015-08-03 18:07:35.000000000 +0000 @@ -15,7 +15,7 @@ #include "fileops.h" #include "config.h" -static git_diff_delta *diff_delta__dup( +git_diff_delta *git_diff__delta_dup( const git_diff_delta *d, git_pool *pool) { git_diff_delta *delta = git__malloc(sizeof(git_diff_delta)); @@ -46,7 +46,7 @@ return NULL; } -static git_diff_delta *diff_delta__merge_like_cgit( +git_diff_delta *git_diff__merge_like_cgit( const git_diff_delta *a, const git_diff_delta *b, git_pool *pool) @@ -65,30 +65,40 @@ * f3 = b->new_file */ + /* If one of the diffs is a conflict, just dup it */ + if (b->status == GIT_DELTA_CONFLICTED) + return git_diff__delta_dup(b, pool); + if (a->status == GIT_DELTA_CONFLICTED) + return git_diff__delta_dup(a, pool); + /* if f2 == f3 or f2 is deleted, then just dup the 'a' diff */ if (b->status == GIT_DELTA_UNMODIFIED || a->status == GIT_DELTA_DELETED) - return diff_delta__dup(a, pool); + return git_diff__delta_dup(a, pool); /* otherwise, base this diff on the 'b' diff */ - if ((dup = diff_delta__dup(b, pool)) == NULL) + if ((dup = git_diff__delta_dup(b, pool)) == NULL) return NULL; /* If 'a' status is uninteresting, then we're done */ - if (a->status == GIT_DELTA_UNMODIFIED) + if (a->status == GIT_DELTA_UNMODIFIED || + a->status == GIT_DELTA_UNTRACKED || + a->status == GIT_DELTA_UNREADABLE) return dup; - assert(a->status != GIT_DELTA_UNMODIFIED); assert(b->status != GIT_DELTA_UNMODIFIED); /* A cgit exception is that the diff of a file that is only in the * index (i.e. not in HEAD nor workdir) is given as empty. */ if (dup->status == GIT_DELTA_DELETED) { - if (a->status == GIT_DELTA_ADDED) + if (a->status == GIT_DELTA_ADDED) { dup->status = GIT_DELTA_UNMODIFIED; + dup->nfiles = 2; + } /* else don't overwrite DELETE status */ } else { dup->status = a->status; + dup->nfiles = a->nfiles; } git_oid_cpy(&dup->old_file.id, &a->old_file.id); @@ -99,40 +109,8 @@ return dup; } -static git_diff_delta *diff_delta__merge_like_cgit_reversed( - const git_diff_delta *a, - const git_diff_delta *b, - git_pool *pool) -{ - git_diff_delta *dup; - - /* reversed version of above logic */ - - if (a->status == GIT_DELTA_UNMODIFIED) - return diff_delta__dup(b, pool); - - if ((dup = diff_delta__dup(a, pool)) == NULL) - return NULL; - - if (b->status == GIT_DELTA_UNMODIFIED || b->status == GIT_DELTA_UNTRACKED || b->status == GIT_DELTA_UNREADABLE) - return dup; - - if (dup->status == GIT_DELTA_DELETED) { - if (b->status == GIT_DELTA_ADDED) - dup->status = GIT_DELTA_UNMODIFIED; - } else { - dup->status = b->status; - } - - git_oid_cpy(&dup->old_file.id, &b->old_file.id); - dup->old_file.mode = b->old_file.mode; - dup->old_file.size = b->old_file.size; - dup->old_file.flags = b->old_file.flags; - - return dup; -} - -int git_diff_merge(git_diff *onto, const git_diff *from) +int git_diff__merge( + git_diff *onto, const git_diff *from, git_diff__merge_cb cb) { int error = 0; git_pool onto_pool; @@ -168,15 +146,16 @@ STRCMP_CASESELECT(ignore_case, o->old_file.path, f->old_file.path); if (cmp < 0) { - delta = diff_delta__dup(o, &onto_pool); + delta = git_diff__delta_dup(o, &onto_pool); i++; } else if (cmp > 0) { - delta = diff_delta__dup(f, &onto_pool); + delta = git_diff__delta_dup(f, &onto_pool); j++; } else { - delta = reversed ? - diff_delta__merge_like_cgit_reversed(o, f, &onto_pool) : - diff_delta__merge_like_cgit(o, f, &onto_pool); + const git_diff_delta *left = reversed ? f : o; + const git_diff_delta *right = reversed ? o : f; + + delta = cb(left, right, &onto_pool); i++; j++; } @@ -184,7 +163,7 @@ /* the ignore rules for the target may not match the source * or the result of a merged delta could be skippable... */ - if (git_diff_delta__should_skip(&onto->opts, delta)) { + if (delta && git_diff_delta__should_skip(&onto->opts, delta)) { git__free(delta); continue; } @@ -215,38 +194,27 @@ return error; } +int git_diff_merge(git_diff *onto, const git_diff *from) +{ + return git_diff__merge(onto, from, git_diff__merge_like_cgit); +} + int git_diff_find_similar__hashsig_for_file( void **out, const git_diff_file *f, const char *path, void *p) { git_hashsig_option_t opt = (git_hashsig_option_t)(intptr_t)p; - int error = 0; GIT_UNUSED(f); - error = git_hashsig_create_fromfile((git_hashsig **)out, path, opt); - - if (error == GIT_EBUFS) { - error = 0; - giterr_clear(); - } - - return error; + return git_hashsig_create_fromfile((git_hashsig **)out, path, opt); } int git_diff_find_similar__hashsig_for_buf( void **out, const git_diff_file *f, const char *buf, size_t len, void *p) { git_hashsig_option_t opt = (git_hashsig_option_t)(intptr_t)p; - int error = 0; GIT_UNUSED(f); - error = git_hashsig_create((git_hashsig **)out, buf, len, opt); - - if (error == GIT_EBUFS) { - error = 0; - giterr_clear(); - } - - return error; + return git_hashsig_create((git_hashsig **)out, buf, len, opt); } void git_diff_find_similar__hashsig_free(void *sig, void *payload) @@ -258,8 +226,14 @@ int git_diff_find_similar__calc_similarity( int *score, void *siga, void *sigb, void *payload) { + int error; + GIT_UNUSED(payload); - *score = git_hashsig_compare(siga, sigb); + error = git_hashsig_compare(siga, sigb); + if (error < 0) + return error; + + *score = error; return 0; } @@ -273,6 +247,7 @@ const git_diff_find_options *given) { git_config *cfg = NULL; + git_hashsig_option_t hashsig_opts; GITERR_CHECK_VERSION(given, GIT_DIFF_FIND_OPTIONS_VERSION, "git_diff_find_options"); @@ -286,7 +261,7 @@ if (!given || (given->flags & GIT_DIFF_FIND_ALL) == GIT_DIFF_FIND_BY_CONFIG) { - const char *rule = + char *rule = git_config__get_string_force(cfg, "diff.renames", "true"); int boolval; @@ -296,6 +271,8 @@ opts->flags |= GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES; else opts->flags |= GIT_DIFF_FIND_RENAMES; + + git__free(rule); } /* some flags imply others */ @@ -354,11 +331,13 @@ opts->metric->similarity = git_diff_find_similar__calc_similarity; if (opts->flags & GIT_DIFF_FIND_IGNORE_WHITESPACE) - opts->metric->payload = (void *)GIT_HASHSIG_IGNORE_WHITESPACE; + hashsig_opts = GIT_HASHSIG_IGNORE_WHITESPACE; else if (opts->flags & GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE) - opts->metric->payload = (void *)GIT_HASHSIG_NORMAL; + hashsig_opts = GIT_HASHSIG_NORMAL; else - opts->metric->payload = (void *)GIT_HASHSIG_SMART_WHITESPACE; + hashsig_opts = GIT_HASHSIG_SMART_WHITESPACE; + hashsig_opts |= GIT_HASHSIG_ALLOW_SMALL_FILES; + opts->metric->payload = (void *)hashsig_opts; } return 0; @@ -368,7 +347,7 @@ git_diff *diff, git_vector *onto, const git_diff_delta *delta) { /* make new record for DELETED side of split */ - git_diff_delta *deleted = diff_delta__dup(delta, &diff->pool); + git_diff_delta *deleted = git_diff__delta_dup(delta, &diff->pool); GITERR_CHECK_ALLOC(deleted); deleted->status = GIT_DELTA_DELETED; @@ -675,11 +654,13 @@ return false; /* only consider ADDED, RENAMED, COPIED, and split MODIFIED as - * targets; maybe include UNTRACKED and IGNORED if requested. + * targets; maybe include UNTRACKED if requested. */ switch (delta->status) { case GIT_DELTA_UNMODIFIED: case GIT_DELTA_DELETED: + case GIT_DELTA_IGNORED: + case GIT_DELTA_CONFLICTED: return false; case GIT_DELTA_MODIFIED: @@ -706,9 +687,6 @@ return false; break; - case GIT_DELTA_IGNORED: - return false; - default: /* all other status values should be checked */ break; } @@ -734,6 +712,7 @@ case GIT_DELTA_UNTRACKED: case GIT_DELTA_UNREADABLE: case GIT_DELTA_IGNORED: + case GIT_DELTA_CONFLICTED: return false; case GIT_DELTA_DELETED: @@ -818,6 +797,7 @@ size_t num_deltas, num_srcs = 0, num_tgts = 0; size_t tried_srcs = 0, tried_tgts = 0; size_t num_rewrites = 0, num_updates = 0, num_bumped = 0; + size_t sigcache_size; void **sigcache = NULL; /* cache of similarity metric file signatures */ diff_find_match *tgt2src = NULL; diff_find_match *src2tgt = NULL; @@ -838,7 +818,8 @@ if ((opts.flags & GIT_DIFF_FIND_ALL) == 0) goto cleanup; - sigcache = git__calloc(num_deltas * 2, sizeof(void *)); + GITERR_CHECK_ALLOC_MULTIPLY(&sigcache_size, num_deltas, 2); + sigcache = git__calloc(sigcache_size, sizeof(void *)); GITERR_CHECK_ALLOC(sigcache); /* Label rename sources and targets diff -Nru libgit2-0.22.2/src/fetch.c libgit2-0.23.1/src/fetch.c --- libgit2-0.22.2/src/fetch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/fetch.c 2015-08-03 18:07:35.000000000 +0000 @@ -19,14 +19,14 @@ #include "repository.h" #include "refs.h" -static int maybe_want(git_remote *remote, git_remote_head *head, git_odb *odb, git_refspec *tagspec) +static int maybe_want(git_remote *remote, git_remote_head *head, git_odb *odb, git_refspec *tagspec, git_remote_autotag_option_t tagopt) { int match = 0; if (!git_reference_is_valid_name(head->name)) return 0; - if (remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { + if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { /* * If tagopt is --tags, always request tags * in addition to the remote's refspecs @@ -51,13 +51,17 @@ return git_vector_insert(&remote->refs, head); } -static int filter_wants(git_remote *remote) +static int filter_wants(git_remote *remote, const git_fetch_options *opts) { git_remote_head **heads; git_refspec tagspec, head; int error = 0; git_odb *odb; size_t i, heads_len; + git_remote_autotag_option_t tagopt = remote->download_tags; + + if (opts && opts->download_tags != GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED) + tagopt = opts->download_tags; git_vector_clear(&remote->refs); if ((error = git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true)) < 0) @@ -87,7 +91,7 @@ goto cleanup; for (i = 0; i < heads_len; i++) { - if ((error = maybe_want(remote, heads[i], odb, &tagspec)) < 0) + if ((error = maybe_want(remote, heads[i], odb, &tagspec, tagopt)) < 0) break; } @@ -102,13 +106,13 @@ * them out. When we get an ACK we hide that commit and continue * traversing until we're done */ -int git_fetch_negotiate(git_remote *remote) +int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts) { git_transport *t = remote->transport; - remote->need_pack = 0; + remote->need_pack = 0; - if (filter_wants(remote) < 0) { + if (filter_wants(remote, opts) < 0) { giterr_set(GITERR_NET, "Failed to filter the reference list for wants"); return -1; } @@ -127,13 +131,26 @@ remote->refs.length); } -int git_fetch_download_pack(git_remote *remote) +int git_fetch_download_pack(git_remote *remote, const git_remote_callbacks *callbacks) { git_transport *t = remote->transport; + git_transfer_progress_cb progress = NULL; + void *payload = NULL; if (!remote->need_pack) return 0; - return t->download_pack(t, remote->repo, &remote->stats, - remote->callbacks.transfer_progress, remote->callbacks.payload); + if (callbacks) { + progress = callbacks->transfer_progress; + payload = callbacks->payload; + } + + return t->download_pack(t, remote->repo, &remote->stats, progress, payload); +} + +int git_fetch_init_options(git_fetch_options *opts, unsigned int version) +{ + GIT_INIT_STRUCTURE_FROM_TEMPLATE( + opts, version, git_fetch_options, GIT_FETCH_OPTIONS_INIT); + return 0; } diff -Nru libgit2-0.22.2/src/fetch.h libgit2-0.23.1/src/fetch.h --- libgit2-0.22.2/src/fetch.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/fetch.h 2015-08-03 18:07:35.000000000 +0000 @@ -9,16 +9,9 @@ #include "netops.h" -int git_fetch_negotiate(git_remote *remote); +int git_fetch_negotiate(git_remote *remote, const git_fetch_options *opts); -int git_fetch_download_pack(git_remote *remote); - -int git_fetch__download_pack( - git_transport *t, - git_repository *repo, - git_transfer_progress *stats, - git_transfer_progress_cb progress_cb, - void *progress_payload); +int git_fetch_download_pack(git_remote *remote, const git_remote_callbacks *callbacks); int git_fetch_setup_walk(git_revwalk **out, git_repository *repo); diff -Nru libgit2-0.22.2/src/filebuf.c libgit2-0.23.1/src/filebuf.c --- libgit2-0.22.2/src/filebuf.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/filebuf.c 2015-08-03 18:07:35.000000000 +0000 @@ -68,7 +68,7 @@ if ((flags & GIT_FILEBUF_APPEND) && git_path_exists(file->path_original) == true) { git_file source; - char buffer[2048]; + char buffer[FILEIO_BUFSIZE]; ssize_t read_bytes; source = p_open(file->path_original, O_RDONLY); @@ -101,7 +101,7 @@ if (file->fd_is_open && file->fd >= 0) p_close(file->fd); - if (file->fd_is_open && file->path_lock && git_path_exists(file->path_lock)) + if (file->created_lock && !file->did_rename && file->path_lock && git_path_exists(file->path_lock)) p_unlink(file->path_lock); if (file->compute_digest) { @@ -194,7 +194,7 @@ int git_filebuf_open(git_filebuf *file, const char *path, int flags, mode_t mode) { int compression, error = -1; - size_t path_len; + size_t path_len, alloc_len; /* opening an already open buffer is a programming error; * assert that this never happens instead of returning @@ -258,6 +258,7 @@ goto cleanup; } file->fd_is_open = true; + file->created_lock = true; /* No original path */ file->path_original = NULL; @@ -271,7 +272,8 @@ GITERR_CHECK_ALLOC(file->path_original); /* create the locking path by appending ".lock" to the original */ - file->path_lock = git__malloc(path_len + GIT_FILELOCK_EXTLENGTH); + GITERR_CHECK_ALLOC_ADD(&alloc_len, path_len, GIT_FILELOCK_EXTLENGTH); + file->path_lock = git__malloc(alloc_len); GITERR_CHECK_ALLOC(file->path_lock); memcpy(file->path_lock, file->path_original, path_len); @@ -280,6 +282,8 @@ /* open the file for locking */ if ((error = lock_file(file, flags, mode)) < 0) goto cleanup; + + file->created_lock = true; } return 0; @@ -339,6 +343,8 @@ goto on_error; } + file->did_rename = true; + git_filebuf_cleanup(file); return 0; @@ -407,8 +413,8 @@ int git_filebuf_printf(git_filebuf *file, const char *format, ...) { va_list arglist; - size_t space_left; - int len, res; + size_t space_left, len, alloclen; + int written, res; char *tmp_buffer; ENSURE_BUF_OK(file); @@ -417,15 +423,16 @@ do { va_start(arglist, format); - len = p_vsnprintf((char *)file->buffer + file->buf_pos, space_left, format, arglist); + written = p_vsnprintf((char *)file->buffer + file->buf_pos, space_left, format, arglist); va_end(arglist); - if (len < 0) { + if (written < 0) { file->last_error = BUFERR_MEM; return -1; } - if ((size_t)len + 1 <= space_left) { + len = written; + if (len + 1 <= space_left) { file->buf_pos += len; return 0; } @@ -435,19 +442,19 @@ space_left = file->buf_size - file->buf_pos; - } while ((size_t)len + 1 <= space_left); + } while (len + 1 <= space_left); - tmp_buffer = git__malloc(len + 1); - if (!tmp_buffer) { + if (GIT_ADD_SIZET_OVERFLOW(&alloclen, len, 1) || + !(tmp_buffer = git__malloc(alloclen))) { file->last_error = BUFERR_MEM; return -1; } va_start(arglist, format); - len = p_vsnprintf(tmp_buffer, len + 1, format, arglist); + written = p_vsnprintf(tmp_buffer, len + 1, format, arglist); va_end(arglist); - if (len < 0) { + if (written < 0) { git__free(tmp_buffer); file->last_error = BUFERR_MEM; return -1; diff -Nru libgit2-0.22.2/src/filebuf.h libgit2-0.23.1/src/filebuf.h --- libgit2-0.22.2/src/filebuf.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/filebuf.h 2015-08-03 18:07:35.000000000 +0000 @@ -44,6 +44,8 @@ size_t buf_size, buf_pos; git_file fd; bool fd_is_open; + bool created_lock; + bool did_rename; bool do_not_buffer; int last_error; }; diff -Nru libgit2-0.22.2/src/fileops.c libgit2-0.23.1/src/fileops.c --- libgit2-0.22.2/src/fileops.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/fileops.c 2015-08-03 18:07:35.000000000 +0000 @@ -7,11 +7,14 @@ #include "common.h" #include "fileops.h" #include "global.h" +#include "strmap.h" #include #if GIT_WIN32 #include "win32/findfile.h" #endif +GIT__USE_STRMAP + int git_futils_mkpath2file(const char *file_path, const mode_t mode) { return git_futils_mkdir( @@ -121,10 +124,17 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len) { ssize_t read_size = 0; + size_t alloc_len; git_buf_clear(buf); - if (git_buf_grow(buf, len + 1) < 0) + if (!git__is_ssizet(len)) { + giterr_set(GITERR_INVALID, "Read too large."); + return -1; + } + + GITERR_CHECK_ALLOC_ADD(&alloc_len, len, 1); + if (git_buf_grow(buf, alloc_len) < 0) return -1; /* p_read loops internally to read len bytes */ @@ -174,7 +184,7 @@ */ if (size && *size != (size_t)st.st_size) changed = true; - if (mtime && *mtime != st.st_mtime) + if (mtime && *mtime != (time_t)st.st_mtime) changed = true; if (!size && !mtime) changed = true; @@ -313,7 +323,7 @@ } else if (!S_ISDIR(st->st_mode)) { - giterr_set(GITERR_INVALID, + giterr_set(GITERR_FILESYSTEM, "Failed to make directory '%s': directory exists", make_path); return GIT_EEXISTS; } @@ -321,12 +331,12 @@ return 0; } -int git_futils_mkdir_withperf( +int git_futils_mkdir_ext( const char *path, const char *base, mode_t mode, uint32_t flags, - struct git_futils_mkdir_perfdata *perfdata) + struct git_futils_mkdir_options *opts) { int error = -1; git_buf make_path = GIT_BUF_INIT; @@ -389,6 +399,7 @@ /* walk down tail of path making each directory */ for (tail = &make_path.ptr[root]; *tail; *tail = lastch) { + bool mkdir_attempted = false; /* advance tail to include next path component */ while (*tail == '/') @@ -401,29 +412,40 @@ *tail = '\0'; st.st_mode = 0; + if (opts->dir_map && git_strmap_exists(opts->dir_map, make_path.ptr)) + continue; + /* See what's going on with this path component */ - perfdata->stat_calls++; + opts->perfdata.stat_calls++; +retry_lstat: if (p_lstat(make_path.ptr, &st) < 0) { - perfdata->mkdir_calls++; - - if (errno != ENOENT || p_mkdir(make_path.ptr, mode) < 0) { - giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr); - error = GIT_EEXISTS; + if (mkdir_attempted || errno != ENOENT) { + giterr_set(GITERR_OS, "Cannot access component in path '%s'", make_path.ptr); + error = -1; goto done; } giterr_clear(); + opts->perfdata.mkdir_calls++; + mkdir_attempted = true; + if (p_mkdir(make_path.ptr, mode) < 0) { + if (errno == EEXIST) + goto retry_lstat; + giterr_set(GITERR_OS, "Failed to make directory '%s'", make_path.ptr); + error = -1; + goto done; + } } else { /* with exclusive create, existing dir is an error */ if ((flags & GIT_MKDIR_EXCL) != 0) { - giterr_set(GITERR_INVALID, "Failed to make directory '%s': directory exists", make_path.ptr); + giterr_set(GITERR_FILESYSTEM, "Failed to make directory '%s': directory exists", make_path.ptr); error = GIT_EEXISTS; goto done; } if ((error = validate_existing( - make_path.ptr, &st, mode, flags, perfdata)) < 0) + make_path.ptr, &st, mode, flags, &opts->perfdata)) < 0) goto done; } @@ -432,7 +454,7 @@ (lastch == '\0' && (flags & GIT_MKDIR_CHMOD) != 0)) && st.st_mode != mode) { - perfdata->chmod_calls++; + opts->perfdata.chmod_calls++; if ((error = p_chmod(make_path.ptr, mode)) < 0 && lastch == '\0') { @@ -441,6 +463,23 @@ goto done; } } + + if (opts->dir_map && opts->pool) { + char *cache_path; + size_t alloc_size; + + GITERR_CHECK_ALLOC_ADD(&alloc_size, make_path.size, 1); + if (!git__is_uint32(alloc_size)) + return -1; + cache_path = git_pool_malloc(opts->pool, (uint32_t)alloc_size); + GITERR_CHECK_ALLOC(cache_path); + + memcpy(cache_path, make_path.ptr, make_path.size + 1); + + git_strmap_insert(opts->dir_map, cache_path, cache_path, error); + if (error < 0) + goto done; + } } error = 0; @@ -448,7 +487,7 @@ /* check that full path really is a directory if requested & needed */ if ((flags & GIT_MKDIR_VERIFY_DIR) != 0 && lastch != '\0') { - perfdata->stat_calls++; + opts->perfdata.stat_calls++; if (p_stat(make_path.ptr, &st) < 0 || !S_ISDIR(st.st_mode)) { giterr_set(GITERR_OS, "Path is not a directory '%s'", @@ -468,8 +507,8 @@ mode_t mode, uint32_t flags) { - struct git_futils_mkdir_perfdata perfdata = {0}; - return git_futils_mkdir_withperf(path, base, mode, flags, &perfdata); + struct git_futils_mkdir_options options = {0}; + return git_futils_mkdir_ext(path, base, mode, flags, &options); } int git_futils_mkdir_r(const char *path, const char *base, const mode_t mode) @@ -650,7 +689,7 @@ static int cp_by_fd(int ifd, int ofd, bool close_fd_when_done) { int error = 0; - char buffer[4096]; + char buffer[FILEIO_BUFSIZE]; ssize_t len = 0; while (!error && (len = p_read(ifd, buffer, sizeof(buffer))) > 0) @@ -664,6 +703,9 @@ error = (int)len; } + if (error < 0) + giterr_set(GITERR_OS, "write error while copying file"); + if (close_fd_when_done) { p_close(ifd); p_close(ofd); @@ -691,7 +733,11 @@ { int error = 0; ssize_t read_len; - char *link_data = git__malloc(link_size + 1); + char *link_data; + size_t alloc_size; + + GITERR_CHECK_ALLOC_ADD(&alloc_size, link_size, 1); + link_data = git__malloc(alloc_size); GITERR_CHECK_ALLOC(link_data); read_len = p_readlink(from, link_data, link_size); @@ -818,7 +864,8 @@ /* make symlink or regular file */ if (info->flags & GIT_CPDIR_LINK_FILES) { - error = p_link(from->ptr, info->to.ptr); + if ((error = p_link(from->ptr, info->to.ptr)) < 0) + giterr_set(GITERR_OS, "failed to link '%s'", from->ptr); } else if (S_ISLNK(from_st.st_mode)) { error = cp_link(from->ptr, info->to.ptr, (size_t)from_st.st_size); } else { diff -Nru libgit2-0.22.2/src/fileops.h libgit2-0.23.1/src/fileops.h --- libgit2-0.22.2/src/fileops.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/fileops.h 2015-08-03 18:07:35.000000000 +0000 @@ -11,6 +11,8 @@ #include "map.h" #include "posix.h" #include "path.h" +#include "pool.h" +#include "strmap.h" /** * Filebuffer methods @@ -95,6 +97,13 @@ size_t chmod_calls; }; +struct git_futils_mkdir_options +{ + git_strmap *dir_map; + git_pool *pool; + struct git_futils_mkdir_perfdata perfdata; +}; + /** * Create a directory or entire path. * @@ -106,10 +115,10 @@ * @param base Root for relative path. These directories will never be made. * @param mode The mode to use for created directories. * @param flags Combination of the mkdir flags above. - * @param perfdata Performance data, use `git_futils_mkdir` if you don't want this data. + * @param opts Extended options, use `git_futils_mkdir` if you are not interested. * @return 0 on success, else error code */ -extern int git_futils_mkdir_withperf(const char *path, const char *base, mode_t mode, uint32_t flags, struct git_futils_mkdir_perfdata *perfdata); +extern int git_futils_mkdir_ext(const char *path, const char *base, mode_t mode, uint32_t flags, struct git_futils_mkdir_options *opts); /** * Create a directory or entire path. Similar to `git_futils_mkdir_withperf` diff -Nru libgit2-0.22.2/src/filter.c libgit2-0.23.1/src/filter.c --- libgit2-0.22.2/src/filter.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/filter.c 2015-08-03 18:07:35.000000000 +0000 @@ -23,10 +23,11 @@ git_oid oid; /* zero if unknown (which is likely) */ uint16_t filemode; /* zero if unknown */ git_filter_mode_t mode; - uint32_t options; + uint32_t flags; }; typedef struct { + const char *filter_name; git_filter *filter; void *payload; } git_filter_entry; @@ -34,6 +35,7 @@ struct git_filter_list { git_array_t(git_filter_entry) filters; git_filter_source source; + git_buf *temp_buf; char path[GIT_FLEX_ARRAY]; }; @@ -228,7 +230,7 @@ const char *name, git_filter *filter, int priority) { git_filter_def *fdef; - size_t nattr = 0, nmatch = 0; + size_t nattr = 0, nmatch = 0, alloc_len; git_buf attrs = GIT_BUF_INIT; assert(name && filter); @@ -245,8 +247,11 @@ if (filter_def_scan_attrs(&attrs, &nattr, &nmatch, filter->attributes) < 0) return -1; - fdef = git__calloc( - sizeof(git_filter_def) + 2 * nattr * sizeof(char *), 1); + GITERR_CHECK_ALLOC_MULTIPLY(&alloc_len, nattr, 2); + GITERR_CHECK_ALLOC_MULTIPLY(&alloc_len, alloc_len, sizeof(char *)); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, sizeof(git_filter_def)); + + fdef = git__calloc(1, alloc_len); GITERR_CHECK_ALLOC(fdef); fdef->filter_name = git__strdup(name); @@ -368,18 +373,21 @@ return src->mode; } -uint32_t git_filter_source_options(const git_filter_source *src) +uint32_t git_filter_source_flags(const git_filter_source *src) { - return src->options; + return src->flags; } static int filter_list_new( git_filter_list **out, const git_filter_source *src) { git_filter_list *fl = NULL; - size_t pathlen = src->path ? strlen(src->path) : 0; + size_t pathlen = src->path ? strlen(src->path) : 0, alloclen; + + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_filter_list), pathlen); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); - fl = git__calloc(1, sizeof(git_filter_list) + pathlen + 1); + fl = git__calloc(1, alloclen); GITERR_CHECK_ALLOC(fl); if (src->path) @@ -387,22 +395,26 @@ fl->source.repo = src->repo; fl->source.path = fl->path; fl->source.mode = src->mode; - fl->source.options = src->options; + fl->source.flags = src->flags; *out = fl; return 0; } static int filter_list_check_attributes( - const char ***out, git_filter_def *fdef, const git_filter_source *src) + const char ***out, + git_repository *repo, + git_attr_session *attr_session, + git_filter_def *fdef, + const git_filter_source *src) { int error; size_t i; const char **strs = git__calloc(fdef->nattrs, sizeof(const char *)); GITERR_CHECK_ALLOC(strs); - error = git_attr_get_many( - strs, src->repo, 0, src->path, fdef->nattrs, fdef->attrs); + error = git_attr_get_many_with_session( + strs, repo, attr_session, 0, src->path, fdef->nattrs, fdef->attrs); /* if no values were found but no matches are needed, it's okay! */ if (error == GIT_ENOTFOUND && !fdef->nmatches) { @@ -438,23 +450,23 @@ git_filter_list **out, git_repository *repo, git_filter_mode_t mode, - uint32_t options) + uint32_t flags) { git_filter_source src = { 0 }; src.repo = repo; src.path = NULL; src.mode = mode; - src.options = options; + src.flags = flags; return filter_list_new(out, &src); } -int git_filter_list_load( +int git_filter_list__load_ext( git_filter_list **filters, git_repository *repo, git_blob *blob, /* can be NULL */ const char *path, git_filter_mode_t mode, - uint32_t options) + git_filter_options *filter_opts) { int error = 0; git_filter_list *fl = NULL; @@ -469,7 +481,8 @@ src.repo = repo; src.path = path; src.mode = mode; - src.options = options; + src.flags = filter_opts->flags; + if (blob) git_oid_cpy(&src.oid, git_blob_id(blob)); @@ -481,7 +494,9 @@ continue; if (fdef->nattrs > 0) { - error = filter_list_check_attributes(&values, fdef, &src); + error = filter_list_check_attributes( + &values, repo, filter_opts->attr_session, fdef, &src); + if (error == GIT_ENOTFOUND) { error = 0; continue; @@ -503,12 +518,18 @@ else if (error < 0) break; else { - if (!fl && (error = filter_list_new(&fl, &src)) < 0) - return error; + if (!fl) { + if ((error = filter_list_new(&fl, &src)) < 0) + return error; + + fl->temp_buf = filter_opts->temp_buf; + } fe = git_array_alloc(fl->filters); GITERR_CHECK_ALLOC(fe); - fe->filter = fdef->filter; + + fe->filter = fdef->filter; + fe->filter_name = fdef->filter_name; fe->payload = payload; } } @@ -523,6 +544,22 @@ return error; } +int git_filter_list_load( + git_filter_list **filters, + git_repository *repo, + git_blob *blob, /* can be NULL */ + const char *path, + git_filter_mode_t mode, + uint32_t flags) +{ + git_filter_options filter_opts = GIT_FILTER_OPTIONS_INIT; + + filter_opts.flags = flags; + + return git_filter_list__load_ext( + filters, repo, blob, path, mode, &filter_opts); +} + void git_filter_list_free(git_filter_list *fl) { uint32_t i; @@ -540,6 +577,25 @@ git__free(fl); } +int git_filter_list_contains( + git_filter_list *fl, + const char *name) +{ + size_t i; + + assert(name); + + if (!fl) + return 0; + + for (i = 0; i < fl->filters.size; i++) { + if (strcmp(fl->filters.ptr[i].filter_name, name) == 0) + return 1; + } + + return 0; +} + int git_filter_list_push( git_filter_list *fl, git_filter *filter, void *payload) { @@ -575,128 +631,350 @@ return fl ? git_array_size(fl->filters) : 0; } -static int filter_list_out_buffer_from_raw( - git_buf *out, const void *ptr, size_t size) +struct buf_stream { + git_writestream parent; + git_buf *target; + bool complete; +}; + +static int buf_stream_write( + git_writestream *s, const char *buffer, size_t len) { - if (git_buf_is_allocated(out)) - git_buf_free(out); + struct buf_stream *buf_stream = (struct buf_stream *)s; + assert(buf_stream); - if (!size) { - git_buf_init(out, 0); - } else { - out->ptr = (char *)ptr; - out->asize = 0; - out->size = size; - } + assert(buf_stream->complete == 0); + + return git_buf_put(buf_stream->target, buffer, len); +} + +static int buf_stream_close(git_writestream *s) +{ + struct buf_stream *buf_stream = (struct buf_stream *)s; + assert(buf_stream); + + assert(buf_stream->complete == 0); + buf_stream->complete = 1; return 0; } +static void buf_stream_free(git_writestream *s) +{ + GIT_UNUSED(s); +} + +static void buf_stream_init(struct buf_stream *writer, git_buf *target) +{ + memset(writer, 0, sizeof(struct buf_stream)); + + writer->parent.write = buf_stream_write; + writer->parent.close = buf_stream_close; + writer->parent.free = buf_stream_free; + writer->target = target; + + git_buf_clear(target); +} + int git_filter_list_apply_to_data( - git_buf *tgt, git_filter_list *fl, git_buf *src) + git_buf *tgt, git_filter_list *filters, git_buf *src) { - int error = 0; - uint32_t i; - git_buf *dbuffer[2], local = GIT_BUF_INIT; - unsigned int si = 0; + struct buf_stream writer; + int error; git_buf_sanitize(tgt); git_buf_sanitize(src); - if (!fl) - return filter_list_out_buffer_from_raw(tgt, src->ptr, src->size); + if (!filters) { + git_buf_attach_notowned(tgt, src->ptr, src->size); + return 0; + } - dbuffer[0] = src; - dbuffer[1] = tgt; + buf_stream_init(&writer, tgt); - /* if `src` buffer is reallocable, then use it, otherwise copy it */ - if (!git_buf_is_allocated(src)) { - if (git_buf_set(&local, src->ptr, src->size) < 0) - return -1; - dbuffer[0] = &local; + if ((error = git_filter_list_stream_data(filters, src, + &writer.parent)) < 0) + return error; + + assert(writer.complete); + return error; +} + +int git_filter_list_apply_to_file( + git_buf *out, + git_filter_list *filters, + git_repository *repo, + const char *path) +{ + struct buf_stream writer; + int error; + + buf_stream_init(&writer, out); + + if ((error = git_filter_list_stream_file( + filters, repo, path, &writer.parent)) < 0) + return error; + + assert(writer.complete); + return error; +} + +static int buf_from_blob(git_buf *out, git_blob *blob) +{ + git_off_t rawsize = git_blob_rawsize(blob); + + if (!git__is_sizet(rawsize)) { + giterr_set(GITERR_OS, "Blob is too large to filter"); + return -1; } - for (i = 0; i < git_array_size(fl->filters); ++i) { - unsigned int di = 1 - si; - uint32_t fidx = (fl->source.mode == GIT_FILTER_TO_WORKTREE) ? - i : git_array_size(fl->filters) - 1 - i; - git_filter_entry *fe = git_array_get(fl->filters, fidx); - - dbuffer[di]->size = 0; - - /* Apply the filter from dbuffer[src] to the other buffer; - * if the filtering is canceled by the user mid-filter, - * we skip to the next filter without changing the source - * of the double buffering (so that the text goes through - * cleanly). + git_buf_attach_notowned(out, git_blob_rawcontent(blob), (size_t)rawsize); + return 0; +} + +int git_filter_list_apply_to_blob( + git_buf *out, + git_filter_list *filters, + git_blob *blob) +{ + struct buf_stream writer; + int error; + + buf_stream_init(&writer, out); + + if ((error = git_filter_list_stream_blob( + filters, blob, &writer.parent)) < 0) + return error; + + assert(writer.complete); + return error; +} + +struct proxy_stream { + git_writestream parent; + git_filter *filter; + const git_filter_source *source; + void **payload; + git_buf input; + git_buf temp_buf; + git_buf *output; + git_writestream *target; +}; + +static int proxy_stream_write( + git_writestream *s, const char *buffer, size_t len) +{ + struct proxy_stream *proxy_stream = (struct proxy_stream *)s; + assert(proxy_stream); + + return git_buf_put(&proxy_stream->input, buffer, len); +} + +static int proxy_stream_close(git_writestream *s) +{ + struct proxy_stream *proxy_stream = (struct proxy_stream *)s; + git_buf *writebuf; + int error; + + assert(proxy_stream); + + error = proxy_stream->filter->apply( + proxy_stream->filter, + proxy_stream->payload, + proxy_stream->output, + &proxy_stream->input, + proxy_stream->source); + + if (error == GIT_PASSTHROUGH) { + writebuf = &proxy_stream->input; + } else if (error == 0) { + git_buf_sanitize(proxy_stream->output); + writebuf = proxy_stream->output; + } else { + return error; + } + + if ((error = proxy_stream->target->write( + proxy_stream->target, writebuf->ptr, writebuf->size)) == 0) + error = proxy_stream->target->close(proxy_stream->target); + + return error; +} + +static void proxy_stream_free(git_writestream *s) +{ + struct proxy_stream *proxy_stream = (struct proxy_stream *)s; + assert(proxy_stream); + + git_buf_free(&proxy_stream->input); + git_buf_free(&proxy_stream->temp_buf); + git__free(proxy_stream); +} + +static int proxy_stream_init( + git_writestream **out, + git_filter *filter, + git_buf *temp_buf, + void **payload, + const git_filter_source *source, + git_writestream *target) +{ + struct proxy_stream *proxy_stream = git__calloc(1, sizeof(struct proxy_stream)); + GITERR_CHECK_ALLOC(proxy_stream); + + proxy_stream->parent.write = proxy_stream_write; + proxy_stream->parent.close = proxy_stream_close; + proxy_stream->parent.free = proxy_stream_free; + proxy_stream->filter = filter; + proxy_stream->payload = payload; + proxy_stream->source = source; + proxy_stream->target = target; + proxy_stream->output = temp_buf ? temp_buf : &proxy_stream->temp_buf; + + if (temp_buf) + git_buf_clear(temp_buf); + + *out = (git_writestream *)proxy_stream; + return 0; +} + +static int stream_list_init( + git_writestream **out, + git_vector *streams, + git_filter_list *filters, + git_writestream *target) +{ + git_writestream *last_stream = target; + size_t i; + int error = 0; + + *out = NULL; + + if (!filters) { + *out = target; + return 0; + } + + /* Create filters last to first to get the chaining direction */ + for (i = 0; i < git_array_size(filters->filters); ++i) { + size_t filter_idx = (filters->source.mode == GIT_FILTER_TO_WORKTREE) ? + git_array_size(filters->filters) - 1 - i : i; + git_filter_entry *fe = git_array_get(filters->filters, filter_idx); + git_writestream *filter_stream; + + assert(fe->filter->stream || fe->filter->apply); + + /* If necessary, create a stream that proxies the traditional + * application. */ + if (fe->filter->stream) + error = fe->filter->stream(&filter_stream, fe->filter, + &fe->payload, &filters->source, last_stream); + else + /* Create a stream that proxies the one-shot apply */ + error = proxy_stream_init(&filter_stream, fe->filter, + filters->temp_buf, &fe->payload, &filters->source, + last_stream); - error = fe->filter->apply( - fe->filter, &fe->payload, dbuffer[di], dbuffer[si], &fl->source); + if (error < 0) + return error; - if (error == GIT_PASSTHROUGH) { - /* PASSTHROUGH means filter decided not to process the buffer */ - error = 0; - } else if (!error) { - git_buf_sanitize(dbuffer[di]); /* force NUL termination */ - si = di; /* swap buffers */ - } else { - tgt->size = 0; - goto cleanup; - } + git_vector_insert(streams, filter_stream); + last_stream = filter_stream; } - /* Ensure that the output ends up in dbuffer[1] (i.e. the dest) */ - if (si != 1) - git_buf_swap(dbuffer[0], dbuffer[1]); + *out = last_stream; + return 0; +} -cleanup: - git_buf_free(&local); /* don't leak if we allocated locally */ +void stream_list_free(git_vector *streams) +{ + git_writestream *stream; + size_t i; - return error; + git_vector_foreach(streams, i, stream) + stream->free(stream); + git_vector_free(streams); } -int git_filter_list_apply_to_file( - git_buf *out, +int git_filter_list_stream_file( git_filter_list *filters, git_repository *repo, - const char *path) + const char *path, + git_writestream *target) { - int error; + char buf[FILTERIO_BUFSIZE]; + git_buf abspath = GIT_BUF_INIT; const char *base = repo ? git_repository_workdir(repo) : NULL; - git_buf abspath = GIT_BUF_INIT, raw = GIT_BUF_INIT; + git_vector filter_streams = GIT_VECTOR_INIT; + git_writestream *stream_start; + ssize_t readlen; + int fd = -1, error; - if (!(error = git_path_join_unrooted(&abspath, path, base, NULL)) && - !(error = git_futils_readbuffer(&raw, abspath.ptr))) - { - error = git_filter_list_apply_to_data(out, filters, &raw); + if ((error = stream_list_init( + &stream_start, &filter_streams, filters, target)) < 0 || + (error = git_path_join_unrooted(&abspath, path, base, NULL)) < 0) + goto done; - git_buf_free(&raw); + if ((fd = git_futils_open_ro(abspath.ptr)) < 0) { + error = fd; + goto done; } + while ((readlen = p_read(fd, buf, sizeof(buf))) > 0) { + if ((error = stream_start->write(stream_start, buf, readlen)) < 0) + goto done; + } + + if (!readlen) + error = stream_start->close(stream_start); + else if (readlen < 0) + error = readlen; + + +done: + if (fd >= 0) + p_close(fd); + stream_list_free(&filter_streams); git_buf_free(&abspath); return error; } -int git_filter_list_apply_to_blob( - git_buf *out, +int git_filter_list_stream_data( git_filter_list *filters, - git_blob *blob) + git_buf *data, + git_writestream *target) +{ + git_vector filter_streams = GIT_VECTOR_INIT; + git_writestream *stream_start; + int error = 0, close_error; + + git_buf_sanitize(data); + + if ((error = stream_list_init(&stream_start, &filter_streams, filters, target)) < 0) + goto out; + + error = stream_start->write(stream_start, data->ptr, data->size); + +out: + close_error = stream_start->close(stream_start); + stream_list_free(&filter_streams); + /* propagate the stream init or write error */ + return error < 0 ? error : close_error; +} + +int git_filter_list_stream_blob( + git_filter_list *filters, + git_blob *blob, + git_writestream *target) { git_buf in = GIT_BUF_INIT; - git_off_t rawsize = git_blob_rawsize(blob); - if (!git__is_sizet(rawsize)) { - giterr_set(GITERR_OS, "Blob is too large to filter"); + if (buf_from_blob(&in, blob) < 0) return -1; - } - - in.ptr = (char *)git_blob_rawcontent(blob); - in.asize = 0; - in.size = (size_t)rawsize; if (filters) git_oid_cpy(&filters->source.oid, git_blob_id(blob)); - return git_filter_list_apply_to_data(out, filters, &in); + return git_filter_list_stream_data(filters, &in, target); } diff -Nru libgit2-0.22.2/src/filter.h libgit2-0.23.1/src/filter.h --- libgit2-0.22.2/src/filter.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/filter.h 2015-08-03 18:07:35.000000000 +0000 @@ -8,6 +8,7 @@ #define INCLUDE_filter_h__ #include "common.h" +#include "attr_file.h" #include "git2/filter.h" /* Amount of file to examine for NUL byte when checking binary-ness */ @@ -23,8 +24,24 @@ GIT_CRLF_AUTO, } git_crlf_t; +typedef struct { + git_attr_session *attr_session; + git_buf *temp_buf; + uint32_t flags; +} git_filter_options; + +#define GIT_FILTER_OPTIONS_INIT {0} + extern void git_filter_free(git_filter *filter); +extern int git_filter_list__load_ext( + git_filter_list **filters, + git_repository *repo, + git_blob *blob, /* can be NULL */ + const char *path, + git_filter_mode_t mode, + git_filter_options *filter_opts); + /* * Available filters */ diff -Nru libgit2-0.22.2/src/fnmatch.c libgit2-0.23.1/src/fnmatch.c --- libgit2-0.22.2/src/fnmatch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/fnmatch.c 2015-08-03 18:07:35.000000000 +0000 @@ -164,8 +164,8 @@ default: normal: if (c != *string && !((flags & FNM_CASEFOLD) && - (tolower((unsigned char)c) == - tolower((unsigned char)*string)))) + (git__tolower((unsigned char)c) == + git__tolower((unsigned char)*string)))) return (FNM_NOMATCH); ++string; break; @@ -190,7 +190,7 @@ ++pattern; if (flags & FNM_CASEFOLD) - test = (char)tolower((unsigned char)test); + test = (char)git__tolower((unsigned char)test); /* * A right bracket shall lose its special meaning and represent @@ -207,7 +207,7 @@ if (c == '/' && (flags & FNM_PATHNAME)) return (RANGE_NOMATCH); if ((flags & FNM_CASEFOLD)) - c = (char)tolower((unsigned char)c); + c = (char)git__tolower((unsigned char)c); if (*pattern == '-' && (c2 = *(pattern+1)) != EOS && c2 != ']') { pattern += 2; @@ -216,7 +216,7 @@ if (c2 == EOS) return (RANGE_ERROR); if (flags & FNM_CASEFOLD) - c2 = (char)tolower((unsigned char)c2); + c2 = (char)git__tolower((unsigned char)c2); if (c <= test && test <= c2) ok = 1; } else if (c == test) diff -Nru libgit2-0.22.2/src/global.c libgit2-0.23.1/src/global.c --- libgit2-0.22.2/src/global.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/global.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,7 +17,7 @@ #define MAX_SHUTDOWN_CB 8 -#ifdef GIT_SSL +#ifdef GIT_OPENSSL # include SSL_CTX *git__ssl_ctx; # ifdef GIT_THREADS @@ -36,19 +36,28 @@ git__shutdown_callbacks[count - 1] = callback; } +static void git__global_state_cleanup(git_global_st *st) +{ + if (!st) + return; + + git__free(st->error_t.message); + st->error_t.message = NULL; +} + static void git__shutdown(void) { int pos; + /* Shutdown subsystems that have registered */ for (pos = git_atomic_get(&git__n_shutdown_callbacks); pos > 0; pos = git_atomic_dec(&git__n_shutdown_callbacks)) { git_global_shutdown_fn cb = git__swap(git__shutdown_callbacks[pos - 1], NULL); if (cb != NULL) cb(); } - } -#if defined(GIT_THREADS) && defined(GIT_SSL) +#if defined(GIT_THREADS) && defined(GIT_OPENSSL) void openssl_locking_function(int mode, int n, const char *file, int line) { int lock; @@ -80,7 +89,7 @@ static void init_ssl(void) { -#ifdef GIT_SSL +#ifdef GIT_OPENSSL long ssl_opts = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3; /* Older OpenSSL and MacOS OpenSSL doesn't have this */ @@ -107,9 +116,23 @@ #endif } +/** + * This function aims to clean-up the SSL context which + * we allocated. + */ +static void uninit_ssl(void) +{ +#ifdef GIT_OPENSSL + if (git__ssl_ctx) { + SSL_CTX_free(git__ssl_ctx); + git__ssl_ctx = NULL; + } +#endif +} + int git_openssl_set_locking(void) { -#ifdef GIT_SSL +#ifdef GIT_OPENSSL # ifdef GIT_THREADS int num_locks, i; @@ -216,6 +239,9 @@ { /* Shut down any subsystems that have global state */ git__shutdown(); + + git__free_tls_data(); + TlsFree(_tls_index); git_mutex_free(&git__mwindow_mutex); } @@ -255,6 +281,22 @@ return ptr; } +/** + * Free the TLS data associated with this thread. + * This should only be used by the thread as it + * is exiting. + */ +void git__free_tls_data(void) +{ + void *ptr = TlsGetValue(_tls_index); + if (!ptr) + return; + + git__global_state_cleanup(ptr); + git__free(ptr); + TlsSetValue(_tls_index, NULL); +} + #elif defined(GIT_THREADS) && defined(_POSIX_THREADS) static pthread_key_t _tls_key; @@ -263,9 +305,7 @@ static void cb__free_status(void *st) { - git_global_st *state = (git_global_st *) st; - git__free(state->error_t.message); - + git__global_state_cleanup(st); git__free(st); } @@ -302,21 +342,24 @@ pthread_once_t new_once = PTHREAD_ONCE_INIT; int ret; - if ((ret = git_atomic_dec(&git__n_inits)) > 0) + if ((ret = git_atomic_dec(&git__n_inits)) != 0) return ret; /* Shut down any subsystems that have global state */ git__shutdown(); + uninit_ssl(); ptr = pthread_getspecific(_tls_key); pthread_setspecific(_tls_key, NULL); + + git__global_state_cleanup(ptr); git__free(ptr); pthread_key_delete(_tls_key); git_mutex_free(&git__mwindow_mutex); _once_init = new_once; - return ret; + return 0; } git_global_st *git__global_state(void) @@ -358,10 +401,14 @@ int ret; /* Shut down any subsystems that have global state */ - if (ret = git_atomic_dec(&git__n_inits)) - git__shutdown(); + if ((ret = git_atomic_dec(&git__n_inits)) != 0) + return ret; - return ret; + git__shutdown(); + git__global_state_cleanup(&__state); + uninit_ssl(); + + return 0; } git_global_st *git__global_state(void) diff -Nru libgit2-0.22.2/src/global.h libgit2-0.23.1/src/global.h --- libgit2-0.22.2/src/global.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/global.h 2015-08-03 18:07:35.000000000 +0000 @@ -17,7 +17,7 @@ char oid_fmt[GIT_OID_HEXSZ+1]; } git_global_st; -#ifdef GIT_SSL +#ifdef GIT_OPENSSL # include extern SSL_CTX *git__ssl_ctx; #endif @@ -32,4 +32,6 @@ extern void git__on_shutdown(git_global_shutdown_fn callback); +extern void git__free_tls_data(void); + #endif diff -Nru libgit2-0.22.2/src/hash/hash_generic.c libgit2-0.23.1/src/hash/hash_generic.c --- libgit2-0.22.2/src/hash/hash_generic.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/hash/hash_generic.c 2015-08-03 18:07:35.000000000 +0000 @@ -18,7 +18,7 @@ * rotate with a loop. */ -#define SHA_ASM(op, x, n) ({ unsigned int __res; __asm__(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; }) +#define SHA_ASM(op, x, n) (__extension__ ({ unsigned int __res; __asm__(op " %1,%0":"=r" (__res):"i" (n), "0" (x)); __res; })) #define SHA_ROL(x,n) SHA_ASM("rol", x, n) #define SHA_ROR(x,n) SHA_ASM("ror", x, n) diff -Nru libgit2-0.22.2/src/hashsig.c libgit2-0.23.1/src/hashsig.c --- libgit2-0.22.2/src/hashsig.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/hashsig.c 2015-08-03 18:07:35.000000000 +0000 @@ -34,8 +34,8 @@ struct git_hashsig { hashsig_heap mins; hashsig_heap maxs; + size_t lines; git_hashsig_option_t opt; - int considered; }; #define HEAP_LCHILD_OF(I) (((I)<<1)+1) @@ -135,25 +135,23 @@ { int i; - switch (sig->opt) { - case GIT_HASHSIG_IGNORE_WHITESPACE: + /* no more than one can be set */ + assert(!(sig->opt & GIT_HASHSIG_IGNORE_WHITESPACE) || + !(sig->opt & GIT_HASHSIG_SMART_WHITESPACE)); + + if (sig->opt & GIT_HASHSIG_IGNORE_WHITESPACE) { for (i = 0; i < 256; ++i) prog->ignore_ch[i] = git__isspace_nonlf(i); prog->use_ignores = 1; - break; - case GIT_HASHSIG_SMART_WHITESPACE: + } else if (sig->opt & GIT_HASHSIG_SMART_WHITESPACE) { for (i = 0; i < 256; ++i) prog->ignore_ch[i] = git__isspace(i); prog->use_ignores = 1; - break; - default: + } else { memset(prog, 0, sizeof(*prog)); - break; } } -#define HASHSIG_IN_PROGRESS_INIT { 1 } - static int hashsig_add_hashes( git_hashsig *sig, const uint8_t *data, @@ -174,12 +172,13 @@ if (use_ignores) for (; scan < end && git__isspace_nonlf(ch); ch = *scan) ++scan; - else if (sig->opt != GIT_HASHSIG_NORMAL) + else if (sig->opt & + (GIT_HASHSIG_IGNORE_WHITESPACE | GIT_HASHSIG_SMART_WHITESPACE)) for (; scan < end && ch == '\r'; ch = *scan) ++scan; /* peek at next character to decide what to do next */ - if (sig->opt == GIT_HASHSIG_SMART_WHITESPACE) + if (sig->opt & GIT_HASHSIG_SMART_WHITESPACE) use_ignores = (ch == '\n'); if (scan >= end) @@ -187,8 +186,10 @@ ++scan; /* check run terminator */ - if (ch == '\n' || ch == '\0') + if (ch == '\n' || ch == '\0') { + sig->lines++; break; + } ++len; HASHSIG_HASH_MIX(state, ch); @@ -198,8 +199,6 @@ hashsig_heap_insert(&sig->mins, (hashsig_t)state); hashsig_heap_insert(&sig->maxs, (hashsig_t)state); - sig->considered++; - while (scan < end && (*scan == '\n' || !*scan)) ++scan; } @@ -212,7 +211,8 @@ static int hashsig_finalize_hashes(git_hashsig *sig) { - if (sig->mins.size < HASHSIG_HEAP_MIN_SIZE) { + if (sig->mins.size < HASHSIG_HEAP_MIN_SIZE && + !(sig->opt & GIT_HASHSIG_ALLOW_SMALL_FILES)) { giterr_set(GITERR_INVALID, "File too small for similarity signature calculation"); return GIT_EBUFS; @@ -336,6 +336,18 @@ int git_hashsig_compare(const git_hashsig *a, const git_hashsig *b) { + /* if we have no elements in either file then each file is either + * empty or blank. if we're ignoring whitespace then the files are + * similar, otherwise they're dissimilar. + */ + if (a->mins.size == 0 && b->mins.size == 0) { + if ((!a->lines && !b->lines) || + (a->opt & GIT_HASHSIG_IGNORE_WHITESPACE)) + return HASHSIG_SCALE; + else + return 0; + } + /* if we have fewer than the maximum number of elements, then just use * one array since the two arrays will be the same */ diff -Nru libgit2-0.22.2/src/ident.c libgit2-0.23.1/src/ident.c --- libgit2-0.22.2/src/ident.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/ident.c 2015-08-03 18:07:35.000000000 +0000 @@ -56,7 +56,7 @@ return GIT_PASSTHROUGH; need_size = (size_t)(id_start - from->ptr) + - 5 /* "$Id: " */ + GIT_OID_HEXSZ + 1 /* "$" */ + + 5 /* "$Id: " */ + GIT_OID_HEXSZ + 2 /* " $" */ + (size_t)(from_end - id_end); if (git_buf_grow(to, need_size) < 0) @@ -65,7 +65,7 @@ git_buf_set(to, from->ptr, (size_t)(id_start - from->ptr)); git_buf_put(to, "$Id: ", 5); git_buf_put(to, oid, GIT_OID_HEXSZ); - git_buf_putc(to, '$'); + git_buf_put(to, " $", 2); git_buf_put(to, id_end, (size_t)(from_end - id_end)); return git_buf_oom(to) ? -1 : 0; diff -Nru libgit2-0.22.2/src/ignore.c libgit2-0.23.1/src/ignore.c --- libgit2-0.22.2/src/ignore.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/ignore.c 2015-08-03 18:07:35.000000000 +0000 @@ -11,6 +11,41 @@ #define GIT_IGNORE_DEFAULT_RULES ".\n..\n.git\n" /** + * A negative ignore pattern can match a positive one without + * wildcards if its pattern equals the tail of the positive + * pattern. Thus + * + * foo/bar + * !bar + * + * would result in foo/bar being unignored again. + */ +static int does_negate_pattern(git_attr_fnmatch *rule, git_attr_fnmatch *neg) +{ + char *p; + + if ((rule->flags & GIT_ATTR_FNMATCH_NEGATIVE) == 0 + && (neg->flags & GIT_ATTR_FNMATCH_NEGATIVE) != 0) { + /* + * no chance of matching if rule is shorter than + * the negated one + */ + if (rule->length < neg->length) + return false; + + /* + * shift pattern so its tail aligns with the + * negated pattern + */ + p = rule->pattern + rule->length - neg->length; + if (strcmp(p, neg->pattern) == 0) + return true; + } + + return false; +} + +/** * A negative ignore can only unignore a file which is given explicitly before, thus * * foo @@ -31,6 +66,8 @@ char *path; git_buf buf = GIT_BUF_INIT; + *out = 0; + /* path of the file relative to the workdir, so we match the rules in subdirs */ if (match->containing_dir) { git_buf_puts(&buf, match->containing_dir); @@ -41,9 +78,15 @@ path = git_buf_detach(&buf); git_vector_foreach(rules, i, rule) { - /* no chance of matching w/o a wilcard */ - if (!(rule->flags & GIT_ATTR_FNMATCH_HASWILD)) - continue; + if (!(rule->flags & GIT_ATTR_FNMATCH_HASWILD)) { + if (does_negate_pattern(rule, match)) { + error = 0; + *out = 1; + goto out; + } + else + continue; + } /* * If we're dealing with a directory (which we know via the @@ -62,7 +105,6 @@ if (error < 0) goto out; - if ((error = p_fnmatch(git_buf_cstr(&buf), path, FNM_PATHNAME)) < 0) { giterr_set(GITERR_INVALID, "error matching pattern"); goto out; @@ -76,7 +118,6 @@ } } - *out = 0; error = 0; out: @@ -161,7 +202,7 @@ git_attr_file *file = NULL; error = git_attr_cache__get( - &file, ignores->repo, GIT_ATTR_FILE__FROM_FILE, + &file, ignores->repo, NULL, GIT_ATTR_FILE__FROM_FILE, base, filename, parse_ignore_file); if (error < 0) return error; @@ -189,7 +230,7 @@ return error; error = git_attr_cache__get( - out, repo, GIT_ATTR_FILE__IN_MEMORY, NULL, GIT_IGNORE_INTERNAL, NULL); + out, repo, NULL, GIT_ATTR_FILE__IN_MEMORY, NULL, GIT_IGNORE_INTERNAL, NULL); /* if internal rules list is empty, insert default rules */ if (!error && !(*out)->rules.length) @@ -348,7 +389,7 @@ } int git_ignore__lookup( - int *out, git_ignores *ignores, const char *pathname) + int *out, git_ignores *ignores, const char *pathname, git_dir_flag dir_flag) { unsigned int i; git_attr_file *file; @@ -357,7 +398,7 @@ *out = GIT_IGNORE_NOTFOUND; if (git_attr_path__init( - &path, pathname, git_repository_workdir(ignores->repo)) < 0) + &path, pathname, git_repository_workdir(ignores->repo), dir_flag) < 0) return -1; /* first process builtins - success means path was found */ @@ -430,7 +471,7 @@ memset(&path, 0, sizeof(path)); memset(&ignores, 0, sizeof(ignores)); - if ((error = git_attr_path__init(&path, pathname, workdir)) < 0 || + if ((error = git_attr_path__init(&path, pathname, workdir, GIT_DIR_FLAG_UNKNOWN)) < 0 || (error = git_ignore__for_path(repo, path.path, &ignores)) < 0) goto cleanup; diff -Nru libgit2-0.22.2/src/ignore.h libgit2-0.23.1/src/ignore.h --- libgit2-0.22.2/src/ignore.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/ignore.h 2015-08-03 18:07:35.000000000 +0000 @@ -49,7 +49,7 @@ GIT_IGNORE_TRUE = 1, }; -extern int git_ignore__lookup(int *out, git_ignores *ign, const char *path); +extern int git_ignore__lookup(int *out, git_ignores *ign, const char *path, git_dir_flag dir_flag); /* command line Git sometimes generates an error message if given a * pathspec that contains an exact match to an ignored file (provided diff -Nru libgit2-0.22.2/src/index.c libgit2-0.23.1/src/index.c --- libgit2-0.22.2/src/index.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/index.c 2015-08-03 18:07:35.000000000 +0000 @@ -24,6 +24,10 @@ #include "git2/config.h" #include "git2/sys/index.h" +static int index_apply_to_wd_diff(git_index *index, int action, const git_strarray *paths, + unsigned int flags, + git_index_matched_path_cb cb, void *payload); + #define entry_size(type,len) ((offsetof(type, path) + (len) + 8) & ~7) #define short_entry_size(len) entry_size(struct entry_short, len) #define long_entry_size(len) entry_size(struct entry_long, len) @@ -112,7 +116,7 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size); static bool is_index_extended(git_index *index); -static int write_index(git_index *index, git_filebuf *file); +static int write_index(git_oid *checksum, git_index *index, git_filebuf *file); static void index_entry_free(git_index_entry *entry); static void index_entry_reuc_free(git_index_reuc_entry *reuc); @@ -594,6 +598,38 @@ (index->no_symlinks ? GIT_INDEXCAP_NO_SYMLINKS : 0)); } +const git_oid *git_index_checksum(git_index *index) +{ + return &index->checksum; +} + +/** + * Returns 1 for changed, 0 for not changed and <0 for errors + */ +static int compare_checksum(git_index *index) +{ + int fd, error; + ssize_t bytes_read; + git_oid checksum = {{ 0 }}; + + if ((fd = p_open(index->index_file_path, O_RDONLY)) < 0) + return fd; + + if ((error = p_lseek(fd, -20, SEEK_END)) < 0) { + p_close(fd); + giterr_set(GITERR_OS, "failed to seek to end of file"); + return -1; + } + + bytes_read = p_read(fd, &checksum, GIT_OID_RAWSZ); + p_close(fd); + + if (bytes_read < 0) + return -1; + + return !!git_oid_cmp(&checksum, &index->checksum); +} + int git_index_read(git_index *index, int force) { int error = 0, updated; @@ -612,8 +648,8 @@ return 0; } - updated = git_futils_filestamp_check(&stamp, index->index_file_path); - if (updated < 0) { + if ((updated = git_futils_filestamp_check(&stamp, index->index_file_path) < 0) || + ((updated = compare_checksum(index)) < 0)) { giterr_set( GITERR_INDEX, "Failed to read index: '%s' no longer exists", @@ -643,54 +679,85 @@ } int git_index__changed_relative_to( - git_index *index, const git_futils_filestamp *fs) + git_index *index, const git_oid *checksum) { /* attempt to update index (ignoring errors) */ if (git_index_read(index, false) < 0) giterr_clear(); - return (index->stamp.mtime != fs->mtime || - index->stamp.size != fs->size || - index->stamp.ino != fs->ino); + return !!git_oid_cmp(&index->checksum, checksum); } -int git_index_write(git_index *index) +static bool is_racy_timestamp(git_time_t stamp, git_index_entry *entry) { - git_filebuf file = GIT_FILEBUF_INIT; + /* Git special-cases submodules in the check */ + if (S_ISGITLINK(entry->mode)) + return false; + + /* If we never read the index, we can't have this race either */ + if (stamp == 0) + return false; + + /* If the timestamp is the same or newer than the index, it's racy */ + return ((int32_t) stamp) <= entry->mtime.seconds; +} + +/* + * Force the next diff to take a look at those entries which have the + * same timestamp as the current index. + */ +static int truncate_racily_clean(git_index *index) +{ + size_t i; int error; + git_index_entry *entry; + git_time_t ts = index->stamp.mtime; + git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff; - if (!index->index_file_path) - return create_index_error(-1, - "Failed to read index: The index is in-memory only"); + /* Nothing to do if there's no repo to talk about */ + if (!INDEX_OWNER(index)) + return 0; - if (index_sort_if_needed(index, true) < 0) - return -1; - git_vector_sort(&index->reuc); + /* If there's no workdir, we can't know where to even check */ + if (!git_repository_workdir(INDEX_OWNER(index))) + return 0; - if ((error = git_filebuf_open( - &file, index->index_file_path, GIT_FILEBUF_HASH_CONTENTS, GIT_INDEX_FILE_MODE)) < 0) { - if (error == GIT_ELOCKED) - giterr_set(GITERR_INDEX, "The index is locked. This might be due to a concurrent or crashed process"); + diff_opts.flags |= GIT_DIFF_INCLUDE_TYPECHANGE | GIT_DIFF_IGNORE_SUBMODULES | GIT_DIFF_DISABLE_PATHSPEC_MATCH; + git_vector_foreach(&index->entries, i, entry) { + if (!is_racy_timestamp(ts, entry)) + continue; - return error; - } + diff_opts.pathspec.count = 1; + diff_opts.pathspec.strings = (char **) &entry->path; - if ((error = write_index(index, &file)) < 0) { - git_filebuf_cleanup(&file); - return error; - } + if ((error = git_diff_index_to_workdir(&diff, INDEX_OWNER(index), index, &diff_opts)) < 0) + return error; - if ((error = git_filebuf_commit(&file)) < 0) - return error; + if (git_diff_num_deltas(diff) > 0) + entry->file_size = 0; - if (git_futils_filestamp_check(&index->stamp, index->index_file_path) < 0) - /* index could not be read from disk! */; - else - index->on_disk = 1; + git_diff_free(diff); + } return 0; } +int git_index_write(git_index *index) +{ + git_indexwriter writer = GIT_INDEXWRITER_INIT; + int error; + + truncate_racily_clean(index); + + if ((error = git_indexwriter_init(&writer, index)) == 0) + error = git_indexwriter_commit(&writer); + + git_indexwriter_cleanup(&writer); + + return error; +} + const char * git_index_path(const git_index *index) { assert(index); @@ -770,7 +837,7 @@ git_repository *repo, const char *path) { - size_t pathlen = strlen(path); + size_t pathlen = strlen(path), alloclen; struct entry_internal *entry; if (!git_path_isvalid(repo, path, @@ -779,7 +846,9 @@ return -1; } - entry = git__calloc(sizeof(struct entry_internal) + pathlen + 1, 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(struct entry_internal), pathlen); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + entry = git__calloc(1, alloclen); GITERR_CHECK_ALLOC(entry); entry->pathlen = pathlen; @@ -826,9 +895,16 @@ static git_index_reuc_entry *reuc_entry_alloc(const char *path) { - size_t pathlen = strlen(path); - struct reuc_entry_internal *entry = - git__calloc(sizeof(struct reuc_entry_internal) + pathlen + 1, 1); + size_t pathlen = strlen(path), + structlen = sizeof(struct reuc_entry_internal), + alloclen; + struct reuc_entry_internal *entry; + + if (GIT_ADD_SIZET_OVERFLOW(&alloclen, structlen, pathlen) || + GIT_ADD_SIZET_OVERFLOW(&alloclen, alloclen, 1)) + return NULL; + + entry = git__calloc(1, alloclen); if (!entry) return NULL; @@ -1002,9 +1078,10 @@ * it, then it will return an error **and also free the entry**. When * it replaces an existing entry, it will update the entry_ptr with the * actual entry in the index (and free the passed in one). + * trust_mode is whether we trust the mode in entry_ptr. */ static int index_insert( - git_index *index, git_index_entry **entry_ptr, int replace) + git_index *index, git_index_entry **entry_ptr, int replace, bool trust_mode) { int error = 0; size_t path_length, position; @@ -1036,7 +1113,10 @@ &position, index, entry->path, 0, GIT_IDXENTRY_STAGE(entry), false)) { existing = index->entries.contents[position]; /* update filemode to existing values if stat is not trusted */ - entry->mode = index_merge_mode(index, existing, entry->mode); + if (trust_mode) + entry->mode = git_index__create_mode(entry->mode); + else + entry->mode = index_merge_mode(index, existing, entry->mode); } /* look for tree / blob name collisions, removing conflicts if requested */ @@ -1097,6 +1177,97 @@ return ret; } +static bool valid_filemode(const int filemode) +{ + return (filemode == GIT_FILEMODE_BLOB || + filemode == GIT_FILEMODE_BLOB_EXECUTABLE || + filemode == GIT_FILEMODE_LINK || + filemode == GIT_FILEMODE_COMMIT); +} + +int git_index_add_frombuffer( + git_index *index, const git_index_entry *source_entry, + const void *buffer, size_t len) +{ + git_index_entry *entry = NULL; + int error = 0; + git_oid id; + + assert(index && source_entry->path); + + if (INDEX_OWNER(index) == NULL) + return create_index_error(-1, + "Could not initialize index entry. " + "Index is not backed up by an existing repository."); + + if (!valid_filemode(source_entry->mode)) { + giterr_set(GITERR_INDEX, "invalid filemode"); + return -1; + } + + if (index_entry_dup(&entry, INDEX_OWNER(index), source_entry) < 0) + return -1; + + error = git_blob_create_frombuffer(&id, INDEX_OWNER(index), buffer, len); + if (error < 0) { + index_entry_free(entry); + return error; + } + + git_oid_cpy(&entry->id, &id); + entry->file_size = len; + + if ((error = index_insert(index, &entry, 1, true)) < 0) + return error; + + /* Adding implies conflict was resolved, move conflict entries to REUC */ + if ((error = index_conflict_to_reuc(index, entry->path)) < 0 && error != GIT_ENOTFOUND) + return error; + + git_tree_cache_invalidate_path(index->tree, entry->path); + return 0; +} + +static int add_repo_as_submodule(git_index_entry **out, git_index *index, const char *path) +{ + git_repository *sub; + git_buf abspath = GIT_BUF_INIT; + git_repository *repo = INDEX_OWNER(index); + git_reference *head; + git_index_entry *entry; + struct stat st; + int error; + + if (index_entry_create(&entry, INDEX_OWNER(index), path) < 0) + return -1; + + if ((error = git_buf_joinpath(&abspath, git_repository_workdir(repo), path)) < 0) + return error; + + if ((error = p_stat(abspath.ptr, &st)) < 0) { + giterr_set(GITERR_OS, "failed to stat repository dir"); + return -1; + } + + git_index_entry__init_from_stat(entry, &st, !index->distrust_filemode); + + if ((error = git_repository_open(&sub, abspath.ptr)) < 0) + return error; + + if ((error = git_repository_head(&head, sub)) < 0) + return error; + + git_oid_cpy(&entry->id, git_reference_target(head)); + entry->mode = GIT_FILEMODE_COMMIT; + + git_reference_free(head); + git_repository_free(sub); + git_buf_free(&abspath); + + *out = entry; + return 0; +} + int git_index_add_bypath(git_index *index, const char *path) { git_index_entry *entry = NULL; @@ -1104,10 +1275,44 @@ assert(index && path); - if ((ret = index_entry_init(&entry, index, path)) < 0 || - (ret = index_insert(index, &entry, 1)) < 0) + if ((ret = index_entry_init(&entry, index, path)) == 0) + ret = index_insert(index, &entry, 1, false); + + /* If we were given a directory, let's see if it's a submodule */ + if (ret < 0 && ret != GIT_EDIRECTORY) return ret; + if (ret == GIT_EDIRECTORY) { + git_submodule *sm; + git_error_state err; + + giterr_capture(&err, ret); + + ret = git_submodule_lookup(&sm, INDEX_OWNER(index), path); + if (ret == GIT_ENOTFOUND) + return giterr_restore(&err); + + git__free(err.error_msg.message); + + /* + * EEXISTS means that there is a repository at that path, but it's not known + * as a submodule. We add its HEAD as an entry and don't register it. + */ + if (ret == GIT_EEXISTS) { + if ((ret = add_repo_as_submodule(&entry, index, path)) < 0) + return ret; + + if ((ret = index_insert(index, &entry, 1, false)) < 0) + return ret; + } else if (ret < 0) { + return ret; + } else { + ret = git_submodule_add_to_index(sm, false); + git_submodule_free(sm); + return ret; + } + } + /* Adding implies conflict was resolved, move conflict entries to REUC */ if ((ret = index_conflict_to_reuc(index, path)) < 0 && ret != GIT_ENOTFOUND) return ret; @@ -1128,15 +1333,10 @@ ret != GIT_ENOTFOUND)) return ret; - return 0; -} + if (ret == GIT_ENOTFOUND) + giterr_clear(); -static bool valid_filemode(const int filemode) -{ - return (filemode == GIT_FILEMODE_BLOB || - filemode == GIT_FILEMODE_BLOB_EXECUTABLE || - filemode == GIT_FILEMODE_LINK || - filemode == GIT_FILEMODE_COMMIT); + return 0; } @@ -1153,7 +1353,7 @@ } if ((ret = index_entry_dup(&entry, INDEX_OWNER(index), source_entry)) < 0 || - (ret = index_insert(index, &entry, 1)) < 0) + (ret = index_insert(index, &entry, 1, true)) < 0) return ret; git_tree_cache_invalidate_path(index->tree, entry->path); @@ -1277,6 +1477,30 @@ (ret = index_entry_dup(&entries[2], INDEX_OWNER(index), their_entry)) < 0) goto on_error; + /* Validate entries */ + for (i = 0; i < 3; i++) { + if (entries[i] && !valid_filemode(entries[i]->mode)) { + giterr_set(GITERR_INDEX, "invalid filemode for stage %d entry", + i); + return -1; + } + } + + /* Remove existing index entries for each path */ + for (i = 0; i < 3; i++) { + if (entries[i] == NULL) + continue; + + if ((ret = git_index_remove(index, entries[i]->path, 0)) != 0) { + if (ret != GIT_ENOTFOUND) + goto on_error; + + giterr_clear(); + ret = 0; + } + } + + /* Add the conflict entries */ for (i = 0; i < 3; i++) { if (entries[i] == NULL) continue; @@ -1284,7 +1508,7 @@ /* Make sure stage is correct */ GIT_IDXENTRY_STAGE_SET(entries[i], i + 1); - if ((ret = index_insert(index, &entries[i], 1)) < 0) + if ((ret = index_insert(index, &entries[i], 0, true)) < 0) goto on_error; entries[i] = NULL; /* don't free if later entry fails */ @@ -1473,7 +1697,7 @@ while (iterator->cur < iterator->index->entries.length) { entry = git_index_get_byindex(iterator->index, iterator->cur); - if (git_index_entry_stage(entry) > 0) { + if (git_index_entry_is_conflict(entry)) { if ((len = index_conflict__get_byindex( ancestor_out, our_out, @@ -2010,6 +2234,8 @@ goto done; } + git_oid_cpy(&index->checksum, &checksum_calculated); + #undef seek_forward /* Entries are stored case-sensitively on disk, so re-sort now if @@ -2273,7 +2499,7 @@ return error; } -static int write_index(git_index *index, git_filebuf *file) +static int write_index(git_oid *checksum, git_index *index, git_filebuf *file) { git_oid hash_final; struct index_header header; @@ -2309,6 +2535,7 @@ /* get out the hash for all the contents we've appended to the file */ git_filebuf_hash(&hash_final, file); + git_oid_cpy(checksum, &hash_final); /* write it at the end of the file */ return git_filebuf_write(file, hash_final.id, GIT_OID_RAWSZ); @@ -2319,6 +2546,11 @@ return GIT_IDXENTRY_STAGE(entry); } +int git_index_entry_is_conflict(const git_index_entry *entry) +{ + return (GIT_IDXENTRY_STAGE(entry) > 0); +} + typedef struct read_tree_data { git_index *index; git_vector *old_entries; @@ -2418,11 +2650,116 @@ return error; } +int git_index_read_index( + git_index *index, + const git_index *new_index) +{ + git_vector new_entries = GIT_VECTOR_INIT, + remove_entries = GIT_VECTOR_INIT; + git_iterator *index_iterator = NULL; + git_iterator *new_iterator = NULL; + const git_index_entry *old_entry, *new_entry; + git_index_entry *entry; + size_t i; + int error; + + if ((error = git_vector_init(&new_entries, new_index->entries.length, index->entries._cmp)) < 0 || + (error = git_vector_init(&remove_entries, index->entries.length, NULL)) < 0) + goto done; + + if ((error = git_iterator_for_index(&index_iterator, + index, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || + (error = git_iterator_for_index(&new_iterator, + (git_index *)new_index, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) + goto done; + + if (((error = git_iterator_current(&old_entry, index_iterator)) < 0 && + error != GIT_ITEROVER) || + ((error = git_iterator_current(&new_entry, new_iterator)) < 0 && + error != GIT_ITEROVER)) + goto done; + + while (true) { + int diff; + + if (old_entry && new_entry) + diff = git_index_entry_cmp(old_entry, new_entry); + else if (!old_entry && new_entry) + diff = 1; + else if (old_entry && !new_entry) + diff = -1; + else + break; + + if (diff < 0) { + git_vector_insert(&remove_entries, (git_index_entry *)old_entry); + } else if (diff > 0) { + if ((error = index_entry_dup(&entry, git_index_owner(index), new_entry)) < 0) + goto done; + + git_vector_insert(&new_entries, entry); + } else { + /* Path and stage are equal, if the OID is equal, keep it to + * keep the stat cache data. + */ + if (git_oid_equal(&old_entry->id, &new_entry->id)) { + git_vector_insert(&new_entries, (git_index_entry *)old_entry); + } else { + if ((error = index_entry_dup(&entry, git_index_owner(index), new_entry)) < 0) + goto done; + + git_vector_insert(&new_entries, entry); + git_vector_insert(&remove_entries, (git_index_entry *)old_entry); + } + } + + if (diff <= 0) { + if ((error = git_iterator_advance(&old_entry, index_iterator)) < 0 && + error != GIT_ITEROVER) + goto done; + } + + if (diff >= 0) { + if ((error = git_iterator_advance(&new_entry, new_iterator)) < 0 && + error != GIT_ITEROVER) + goto done; + } + } + + git_index_name_clear(index); + git_index_reuc_clear(index); + + git_vector_swap(&new_entries, &index->entries); + + git_vector_foreach(&remove_entries, i, entry) { + if (index->tree) + git_tree_cache_invalidate_path(index->tree, entry->path); + + index_entry_free(entry); + } + + error = 0; + +done: + git_vector_free(&new_entries); + git_vector_free(&remove_entries); + git_iterator_free(index_iterator); + git_iterator_free(new_iterator); + return error; +} + git_repository *git_index_owner(const git_index *index) { return INDEX_OWNER(index); } +enum { + INDEX_ACTION_NONE = 0, + INDEX_ACTION_UPDATE = 1, + INDEX_ACTION_REMOVE = 2, + INDEX_ACTION_ADDALL = 3, +}; + int git_index_add_all( git_index *index, const git_strarray *paths, @@ -2433,29 +2770,15 @@ int error; git_repository *repo; git_iterator *wditer = NULL; - const git_index_entry *wd = NULL; - git_index_entry *entry; git_pathspec ps; - const char *match; - size_t existing; bool no_fnmatch = (flags & GIT_INDEX_ADD_DISABLE_PATHSPEC_MATCH) != 0; - int ignorecase; - git_oid blobid; assert(index); - if (INDEX_OWNER(index) == NULL) - return create_index_error(-1, - "Could not add paths to index. " - "Index is not backed up by an existing repository."); - repo = INDEX_OWNER(index); if ((error = git_repository__ensure_not_bare(repo, "index add all")) < 0) return error; - if (git_repository__cvar(&ignorecase, repo, GIT_CVAR_IGNORECASE) < 0) - return -1; - if ((error = git_pathspec__init(&ps, paths)) < 0) return error; @@ -2466,77 +2789,118 @@ repo, &ps.pathspec, no_fnmatch)) < 0) goto cleanup; - if ((error = git_iterator_for_workdir( - &wditer, repo, NULL, NULL, 0, ps.prefix, ps.prefix)) < 0) - goto cleanup; + error = index_apply_to_wd_diff(index, INDEX_ACTION_ADDALL, paths, flags, cb, payload); - while (!(error = git_iterator_advance(&wd, wditer))) { + if (error) + giterr_set_after_callback(error); - /* check if path actually matches */ - if (!git_pathspec__match( - &ps.pathspec, wd->path, no_fnmatch, (bool)ignorecase, &match, NULL)) - continue; +cleanup: + git_iterator_free(wditer); + git_pathspec__clear(&ps); - /* skip ignored items that are not already in the index */ - if ((flags & GIT_INDEX_ADD_FORCE) == 0 && - git_iterator_current_is_ignored(wditer) && - index_find(&existing, index, wd->path, 0, 0, true) < 0) - continue; + return error; +} - /* issue notification callback if requested */ - if (cb && (error = cb(wd->path, match, payload)) != 0) { - if (error > 0) /* return > 0 means skip this one */ - continue; - if (error < 0) { /* return < 0 means abort */ - giterr_set_after_callback(error); - break; - } - } +struct foreach_diff_data { + git_index *index; + const git_pathspec *pathspec; + unsigned int flags; + git_index_matched_path_cb cb; + void *payload; +}; - /* TODO: Should we check if the file on disk is already an exact - * match to the file in the index and skip this work if it is? - */ +static int apply_each_file(const git_diff_delta *delta, float progress, void *payload) +{ + struct foreach_diff_data *data = payload; + const char *match, *path; + int error = 0; - /* write the blob to disk and get the oid */ - if ((error = git_blob_create_fromworkdir(&blobid, repo, wd->path)) < 0) - break; + GIT_UNUSED(progress); - /* make the new entry to insert */ - if ((error = index_entry_dup(&entry, INDEX_OWNER(index), wd)) < 0) - break; + path = delta->old_file.path; - entry->id = blobid; + /* We only want those which match the pathspecs */ + if (!git_pathspec__match( + &data->pathspec->pathspec, path, false, (bool)data->index->ignore_case, + &match, NULL)) + return 0; - /* add working directory item to index */ - if ((error = index_insert(index, &entry, 1)) < 0) - break; + if (data->cb) + error = data->cb(path, match, data->payload); - git_tree_cache_invalidate_path(index->tree, wd->path); + if (error > 0) /* skip this entry */ + return 0; + if (error < 0) /* actual error */ + return error; - /* add implies conflict resolved, move conflict entries to REUC */ - if ((error = index_conflict_to_reuc(index, wd->path)) < 0) { - if (error != GIT_ENOTFOUND) - break; - giterr_clear(); - } + /* If the workdir item does not exist, remove it from the index. */ + if ((delta->new_file.flags & GIT_DIFF_FLAG_EXISTS) == 0) + error = git_index_remove_bypath(data->index, path); + else + error = git_index_add_bypath(data->index, delta->new_file.path); + + return error; +} + +static int index_apply_to_wd_diff(git_index *index, int action, const git_strarray *paths, + unsigned int flags, + git_index_matched_path_cb cb, void *payload) +{ + int error; + git_diff *diff; + git_pathspec ps; + git_repository *repo; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + struct foreach_diff_data data = { + index, + NULL, + flags, + cb, + payload, + }; + + assert(index); + assert(action == INDEX_ACTION_UPDATE || action == INDEX_ACTION_ADDALL); + + repo = INDEX_OWNER(index); + + if (!repo) { + return create_index_error(-1, + "cannot run update; the index is not backed up by a repository."); + } + + /* + * We do the matching ourselves intead of passing the list to + * diff because we want to tell the callback which one + * matched, which we do not know if we ask diff to filter for us. + */ + if ((error = git_pathspec__init(&ps, paths)) < 0) + return error; + + opts.flags = GIT_DIFF_INCLUDE_TYPECHANGE; + if (action == INDEX_ACTION_ADDALL) { + opts.flags |= GIT_DIFF_INCLUDE_UNTRACKED | + GIT_DIFF_RECURSE_UNTRACKED_DIRS; + + if (flags == GIT_INDEX_ADD_FORCE) + opts.flags |= GIT_DIFF_INCLUDE_IGNORED; } - if (error == GIT_ITEROVER) - error = 0; + if ((error = git_diff_index_to_workdir(&diff, repo, index, &opts)) < 0) + goto cleanup; + + data.pathspec = &ps; + error = git_diff_foreach(diff, apply_each_file, NULL, NULL, NULL, &data); + git_diff_free(diff); + + if (error) /* make sure error is set if callback stopped iteration */ + giterr_set_after_callback(error); cleanup: - git_iterator_free(wditer); git_pathspec__clear(&ps); - return error; } -enum { - INDEX_ACTION_NONE = 0, - INDEX_ACTION_UPDATE = 1, - INDEX_ACTION_REMOVE = 2, -}; - static int index_apply_to_all( git_index *index, int action, @@ -2633,9 +2997,7 @@ git_index_matched_path_cb cb, void *payload) { - int error = index_apply_to_all( - index, INDEX_ACTION_UPDATE, pathspec, cb, payload); - + int error = index_apply_to_wd_diff(index, INDEX_ACTION_UPDATE, pathspec, 0, cb, payload); if (error) /* make sure error is set if callback stopped iteration */ giterr_set_after_callback(error); @@ -2686,3 +3048,93 @@ { return index_find_in_entries(out, entries, entry_srch, path, path_len, stage); } + +int git_indexwriter_init( + git_indexwriter *writer, + git_index *index) +{ + int error; + + GIT_REFCOUNT_INC(index); + + writer->index = index; + + if (!index->index_file_path) + return create_index_error(-1, + "Failed to write index: The index is in-memory only"); + + if ((error = git_filebuf_open( + &writer->file, index->index_file_path, GIT_FILEBUF_HASH_CONTENTS, GIT_INDEX_FILE_MODE)) < 0) { + + if (error == GIT_ELOCKED) + giterr_set(GITERR_INDEX, "The index is locked. This might be due to a concurrent or crashed process"); + + return error; + } + + writer->should_write = 1; + + return 0; +} + +int git_indexwriter_init_for_operation( + git_indexwriter *writer, + git_repository *repo, + unsigned int *checkout_strategy) +{ + git_index *index; + int error; + + if ((error = git_repository_index__weakptr(&index, repo)) < 0 || + (error = git_indexwriter_init(writer, index)) < 0) + return error; + + writer->should_write = (*checkout_strategy & GIT_CHECKOUT_DONT_WRITE_INDEX) == 0; + *checkout_strategy |= GIT_CHECKOUT_DONT_WRITE_INDEX; + + return 0; +} + +int git_indexwriter_commit(git_indexwriter *writer) +{ + int error; + git_oid checksum = {{ 0 }}; + + if (!writer->should_write) + return 0; + + if (index_sort_if_needed(writer->index, true) < 0) + return -1; + + git_vector_sort(&writer->index->reuc); + + if ((error = write_index(&checksum, writer->index, &writer->file)) < 0) { + git_indexwriter_cleanup(writer); + return error; + } + + if ((error = git_filebuf_commit(&writer->file)) < 0) + return error; + + if ((error = git_futils_filestamp_check( + &writer->index->stamp, writer->index->index_file_path)) < 0) { + giterr_set(GITERR_OS, "Could not read index timestamp"); + return -1; + } + + writer->index->on_disk = 1; + git_oid_cpy(&writer->index->checksum, &checksum); + + git_index_free(writer->index); + writer->index = NULL; + + return 0; +} + +void git_indexwriter_cleanup(git_indexwriter *writer) +{ + git_filebuf_cleanup(&writer->file); + + git_index_free(writer->index); + writer->index = NULL; +} diff -Nru libgit2-0.22.2/src/indexer.c libgit2-0.23.1/src/indexer.c --- libgit2-0.22.2/src/indexer.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/indexer.c 2015-08-03 18:07:35.000000000 +0000 @@ -18,6 +18,8 @@ #include "oidmap.h" #include "zstream.h" +GIT__USE_OIDMAP + extern git_mutex git__mwindow_mutex; #define UINT31_MAX (0x7FFFFFFF) @@ -287,12 +289,19 @@ pentry->offset = entry_start; k = kh_put(oid, idx->pack->idx_cache, &pentry->sha1, &error); - if (!error) { + if (error == -1) { git__free(pentry); - giterr_set(GITERR_INDEXER, "cannot handle duplicate objects in pack"); + giterr_set_oom(); goto on_error; } + if (error == 0) { + giterr_set(GITERR_INDEXER, "duplicate object %s found in pack", git_oid_tostr_s(&pentry->sha1)); + git__free(pentry); + goto on_error; + } + + kh_value(idx->pack->idx_cache, k) = pentry; git_oid_cpy(&entry->oid, &oid); @@ -316,6 +325,13 @@ return -1; } +GIT_INLINE(bool) has_entry(git_indexer *idx, git_oid *id) +{ + khiter_t k; + k = kh_get(oid, idx->pack->idx_cache, id); + return (k != kh_end(idx->pack->idx_cache)); +} + static int save_entry(git_indexer *idx, struct entry *entry, struct git_pack_entry *pentry, git_off_t entry_start) { int i, error; @@ -330,8 +346,11 @@ pentry->offset = entry_start; k = kh_put(oid, idx->pack->idx_cache, &pentry->sha1, &error); - if (!error) + + if (error <= 0) { + giterr_set(GITERR_INDEXER, "cannot insert object into pack"); return -1; + } kh_value(idx->pack->idx_cache, k) = pentry; @@ -459,13 +478,14 @@ static int append_to_pack(git_indexer *idx, const void *data, size_t size) { git_off_t current_size = idx->pack->mwf.size; + int fd = idx->pack->mwf.fd; if (!size) return 0; - /* add the extra space we need at the end */ - if (p_ftruncate(idx->pack->mwf.fd, current_size + size) < 0) { - giterr_set(GITERR_OS, "Failed to increase size of pack file '%s'", idx->pack->pack_name); + if (p_lseek(fd, current_size + size - 1, SEEK_SET) < 0 || + p_write(idx->pack->mwf.fd, data, 1) < 0) { + giterr_set(GITERR_OS, "cannot extend packfile '%s'", idx->pack->pack_name); return -1; } @@ -782,6 +802,9 @@ git_oid_fromraw(&base, base_info); git_mwindow_close(&w); + if (has_entry(idx, &base)) + return 0; + if (inject_object(idx, &base) < 0) return -1; @@ -800,7 +823,7 @@ progressed = 0; non_null = 0; git_vector_foreach(&idx->deltas, i, delta) { - git_rawobj obj; + git_rawobj obj = {NULL}; if (!delta) continue; diff -Nru libgit2-0.22.2/src/index.h libgit2-0.23.1/src/index.h --- libgit2-0.22.2/src/index.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/index.h 2015-08-03 18:07:35.000000000 +0000 @@ -22,6 +22,7 @@ char *index_file_path; git_futils_filestamp stamp; + git_oid checksum; /* checksum at the end of the file */ git_vector entries; @@ -80,7 +81,7 @@ return &index->stamp; } -extern int git_index__changed_relative_to(git_index *index, const git_futils_filestamp *fs); +extern int git_index__changed_relative_to(git_index *index, const git_oid *checksum); /* Copy the current entries vector *and* increment the index refcount. * Call `git_index__release_snapshot` when done. @@ -93,5 +94,36 @@ size_t *at_pos, git_vector *snap, git_vector_cmp entry_srch, const char *path, size_t path_len, int stage); +/* Replace an index with a new index */ +int git_index_read_index(git_index *index, const git_index *new_index); + +typedef struct { + git_index *index; + git_filebuf file; + unsigned int should_write:1; +} git_indexwriter; + +#define GIT_INDEXWRITER_INIT { NULL, GIT_FILEBUF_INIT } + +/* Lock the index for eventual writing. */ +extern int git_indexwriter_init(git_indexwriter *writer, git_index *index); + +/* Lock the index for eventual writing by a repository operation: a merge, + * revert, cherry-pick or a rebase. Note that the given checkout strategy + * will be updated for the operation's use so that checkout will not write + * the index. + */ +extern int git_indexwriter_init_for_operation( + git_indexwriter *writer, + git_repository *repo, + unsigned int *checkout_strategy); + +/* Write the index and unlock it. */ +extern int git_indexwriter_commit(git_indexwriter *writer); + +/* Cleanup an index writing session, unlocking the file (if it is still + * locked and freeing any data structures. + */ +extern void git_indexwriter_cleanup(git_indexwriter *writer); #endif diff -Nru libgit2-0.22.2/src/integer.h libgit2-0.23.1/src/integer.h --- libgit2-0.22.2/src/integer.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/integer.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_integer_h__ +#define INCLUDE_integer_h__ + +/** @return true if p fits into the range of a size_t */ +GIT_INLINE(int) git__is_sizet(git_off_t p) +{ + size_t r = (size_t)p; + return p == (git_off_t)r; +} + +/** @return true if p fits into the range of an ssize_t */ +GIT_INLINE(int) git__is_ssizet(size_t p) +{ + ssize_t r = (ssize_t)p; + return p == (size_t)r; +} + +/** @return true if p fits into the range of a uint32_t */ +GIT_INLINE(int) git__is_uint32(size_t p) +{ + uint32_t r = (uint32_t)p; + return p == (size_t)r; +} + +/** @return true if p fits into the range of an unsigned long */ +GIT_INLINE(int) git__is_ulong(git_off_t p) +{ + unsigned long r = (unsigned long)p; + return p == (git_off_t)r; +} + +/** @return true if p fits into the range of an int */ +GIT_INLINE(int) git__is_int(long long p) +{ + int r = (int)p; + return p == (long long)r; +} + +/** + * Sets `one + two` into `out`, unless the arithmetic would overflow. + * @return true if the result fits in a `uint64_t`, false on overflow. + */ +GIT_INLINE(bool) git__add_uint64_overflow(uint64_t *out, uint64_t one, uint64_t two) +{ + if (UINT64_MAX - one < two) + return true; + *out = one + two; + return false; +} + +/* Use clang/gcc compiler intrinsics whenever possible */ +#if (SIZE_MAX == UINT_MAX) && __has_builtin(__builtin_uadd_overflow) +# define git__add_sizet_overflow(out, one, two) \ + __builtin_uadd_overflow(one, two, out) +# define git__multiply_sizet_overflow(out, one, two) \ + __builtin_umul_overflow(one, two, out) +#elif (SIZE_MAX == ULONG_MAX) && __has_builtin(__builtin_uaddl_overflow) +# define git__add_sizet_overflow(out, one, two) \ + __builtin_uaddl_overflow(one, two, out) +# define git__multiply_sizet_overflow(out, one, two) \ + __builtin_umull_overflow(one, two, out) +#else + +/** + * Sets `one + two` into `out`, unless the arithmetic would overflow. + * @return true if the result fits in a `size_t`, false on overflow. + */ +GIT_INLINE(bool) git__add_sizet_overflow(size_t *out, size_t one, size_t two) +{ + if (SIZE_MAX - one < two) + return true; + *out = one + two; + return false; +} + +/** + * Sets `one * two` into `out`, unless the arithmetic would overflow. + * @return true if the result fits in a `size_t`, false on overflow. + */ +GIT_INLINE(bool) git__multiply_sizet_overflow(size_t *out, size_t one, size_t two) +{ + if (one && SIZE_MAX / one < two) + return true; + *out = one * two; + return false; +} + +#endif + +#endif /* INCLUDE_integer_h__ */ diff -Nru libgit2-0.22.2/src/iterator.c libgit2-0.23.1/src/iterator.c --- libgit2-0.22.2/src/iterator.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/iterator.c 2015-08-03 18:07:35.000000000 +0000 @@ -46,6 +46,7 @@ #define iterator__include_trees(I) iterator__flag(I,INCLUDE_TREES) #define iterator__dont_autoexpand(I) iterator__flag(I,DONT_AUTOEXPAND) #define iterator__do_autoexpand(I) !iterator__flag(I,DONT_AUTOEXPAND) +#define iterator__include_conflicts(I) iterator__flag(I, INCLUDE_CONFLICTS) #define GIT_ITERATOR_FIRST_ACCESS (1 << 15) #define iterator__has_been_accessed(I) iterator__flag(I,FIRST_ACCESS) @@ -336,7 +337,7 @@ { int error = 0; tree_iterator_frame *head = ti->head, *tf = NULL; - size_t i, n_entries = 0; + size_t i, n_entries = 0, alloclen; if (head->current >= head->n_entries || !head->entries[head->current]->tree) return GIT_ITEROVER; @@ -344,8 +345,10 @@ for (i = head->current; i < head->next; ++i) n_entries += git_tree_entrycount(head->entries[i]->tree); - tf = git__calloc(sizeof(tree_iterator_frame) + - n_entries * sizeof(tree_iterator_entry *), 1); + GITERR_CHECK_ALLOC_MULTIPLY(&alloclen, sizeof(tree_iterator_entry *), n_entries); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, sizeof(tree_iterator_frame)); + + tf = git__calloc(1, alloclen); GITERR_CHECK_ALLOC(tf); tf->n_entries = n_entries; @@ -666,13 +669,16 @@ return ie; } -static const git_index_entry *index_iterator__skip_conflicts(index_iterator *ii) +static const git_index_entry *index_iterator__advance_over_conflicts(index_iterator *ii) { - const git_index_entry *ie; + const git_index_entry *ie = index_iterator__index_entry(ii); - while ((ie = index_iterator__index_entry(ii)) != NULL && - git_index_entry_stage(ie) != 0) - ii->current++; + if (!iterator__include_conflicts(ii)) { + while (ie && git_index_entry_is_conflict(ie)) { + ii->current++; + ie = index_iterator__index_entry(ii); + } + } return ie; } @@ -700,7 +706,7 @@ static int index_iterator__first_prefix_tree(index_iterator *ii) { - const git_index_entry *ie = index_iterator__skip_conflicts(ii); + const git_index_entry *ie = index_iterator__advance_over_conflicts(ii); const char *scan, *prior, *slash; if (!ie || !iterator__include_trees(ii)) @@ -823,7 +829,7 @@ git_index_snapshot_find( &ii->current, &ii->entries, ii->entry_srch, ii->base.start, 0, 0); - if ((ie = index_iterator__skip_conflicts(ii)) == NULL) + if ((ie = index_iterator__advance_over_conflicts(ii)) == NULL) return 0; if (git_buf_sets(&ii->partial, ie->path) < 0) @@ -918,12 +924,31 @@ #define FS_MAX_DEPTH 100 +typedef struct { + struct stat st; + size_t path_len; + char path[GIT_FLEX_ARRAY]; +} fs_iterator_path_with_stat; + +static int fs_iterator_path_with_stat_cmp(const void *a, const void *b) +{ + const fs_iterator_path_with_stat *psa = a, *psb = b; + return strcmp(psa->path, psb->path); +} + +static int fs_iterator_path_with_stat_cmp_icase(const void *a, const void *b) +{ + const fs_iterator_path_with_stat *psa = a, *psb = b; + return strcasecmp(psa->path, psb->path); +} + static fs_iterator_frame *fs_iterator__alloc_frame(fs_iterator *fi) { fs_iterator_frame *ff = git__calloc(1, sizeof(fs_iterator_frame)); git_vector_cmp entry_compare = CASESELECT( iterator__ignore_case(fi), - git_path_with_stat_cmp_icase, git_path_with_stat_cmp); + fs_iterator_path_with_stat_cmp_icase, + fs_iterator_path_with_stat_cmp); if (ff && git_vector_init(&ff->entries, 0, entry_compare) < 0) { git__free(ff); @@ -965,7 +990,7 @@ static int fs_iterator__entry_cmp(const void *i, const void *item) { const fs_iterator *fi = (const fs_iterator *)i; - const git_path_with_stat *ps = item; + const fs_iterator_path_with_stat *ps = item; return fi->base.prefixcomp(fi->base.start, ps->path); } @@ -982,6 +1007,99 @@ ff->index = 0; } +static int dirload_with_stat( + const char *dirpath, + size_t prefix_len, + unsigned int flags, + const char *start_stat, + const char *end_stat, + git_vector *contents) +{ + git_path_diriter diriter = GIT_PATH_DIRITER_INIT; + const char *path; + int (*strncomp)(const char *a, const char *b, size_t sz); + size_t start_len = start_stat ? strlen(start_stat) : 0; + size_t end_len = end_stat ? strlen(end_stat) : 0; + fs_iterator_path_with_stat *ps; + size_t path_len, cmp_len, ps_size; + int error; + + strncomp = (flags & GIT_PATH_DIR_IGNORE_CASE) != 0 ? + git__strncasecmp : git__strncmp; + + /* Any error here is equivalent to the dir not existing, skip over it */ + if ((error = git_path_diriter_init(&diriter, dirpath, flags)) < 0) { + error = GIT_ENOTFOUND; + goto done; + } + + while ((error = git_path_diriter_next(&diriter)) == 0) { + if ((error = git_path_diriter_fullpath(&path, &path_len, &diriter)) < 0) + goto done; + + assert(path_len > prefix_len); + + /* remove the prefix if requested */ + path += prefix_len; + path_len -= prefix_len; + + /* skip if before start_stat or after end_stat */ + cmp_len = min(start_len, path_len); + if (cmp_len && strncomp(path, start_stat, cmp_len) < 0) + continue; + cmp_len = min(end_len, path_len); + if (cmp_len && strncomp(path, end_stat, cmp_len) > 0) + continue; + + /* Make sure to append two bytes, one for the path's null + * termination, one for a possible trailing '/' for folders. + */ + GITERR_CHECK_ALLOC_ADD(&ps_size, sizeof(fs_iterator_path_with_stat), path_len); + GITERR_CHECK_ALLOC_ADD(&ps_size, ps_size, 2); + + ps = git__calloc(1, ps_size); + ps->path_len = path_len; + + memcpy(ps->path, path, path_len); + + if ((error = git_path_diriter_stat(&ps->st, &diriter)) < 0) { + if (error == GIT_ENOTFOUND) { + /* file was removed between readdir and lstat */ + git__free(ps); + continue; + } + + /* Treat the file as unreadable if we get any other error */ + memset(&ps->st, 0, sizeof(ps->st)); + ps->st.st_mode = GIT_FILEMODE_UNREADABLE; + + giterr_clear(); + error = 0; + } else if (S_ISDIR(ps->st.st_mode)) { + /* Suffix directory paths with a '/' */ + ps->path[ps->path_len++] = '/'; + ps->path[ps->path_len] = '\0'; + } else if(!S_ISREG(ps->st.st_mode) && !S_ISLNK(ps->st.st_mode)) { + /* Ignore wacky things in the filesystem */ + git__free(ps); + continue; + } + + git_vector_insert(contents, ps); + } + + if (error == GIT_ITEROVER) + error = 0; + + /* sort now that directory suffix is added */ + git_vector_sort(contents); + +done: + git_path_diriter_free(&diriter); + return error; +} + + static int fs_iterator__expand_dir(fs_iterator *fi) { int error; @@ -996,7 +1114,7 @@ ff = fs_iterator__alloc_frame(fi); GITERR_CHECK_ALLOC(ff); - error = git_path_dirload_with_stat( + error = dirload_with_stat( fi->path.ptr, fi->root_len, fi->dirload_flags, fi->base.start, fi->base.end, &ff->entries); @@ -1084,7 +1202,7 @@ int error = 0; fs_iterator *fi = (fs_iterator *)self; fs_iterator_frame *ff; - git_path_with_stat *next; + fs_iterator_path_with_stat *next; if (entry != NULL) *entry = NULL; @@ -1174,7 +1292,7 @@ static int fs_iterator__update_entry(fs_iterator *fi) { - git_path_with_stat *ps; + fs_iterator_path_with_stat *ps; memset(&fi->entry, 0, sizeof(fi->entry)); @@ -1290,10 +1408,10 @@ if (path->ptr[len - 1] == '/') len--; - if (tolower(path->ptr[len - 1]) != 't' || - tolower(path->ptr[len - 2]) != 'i' || - tolower(path->ptr[len - 3]) != 'g' || - tolower(path->ptr[len - 4]) != '.') + if (git__tolower(path->ptr[len - 1]) != 't' || + git__tolower(path->ptr[len - 2]) != 'i' || + git__tolower(path->ptr[len - 3]) != 'g' || + git__tolower(path->ptr[len - 4]) != '.') return false; return (len == 4 || path->ptr[len - 5] == '/'); @@ -1305,7 +1423,7 @@ * We consider it a submodule if the path is listed as a submodule in * either the tree or the index. */ -static int is_submodule(workdir_iterator *wi, git_path_with_stat *ie) +static int is_submodule(workdir_iterator *wi, fs_iterator_path_with_stat *ie) { int error, is_submodule = 0; @@ -1342,17 +1460,29 @@ return is_submodule; } +GIT_INLINE(git_dir_flag) git_entry__dir_flag(git_index_entry *entry) { +#if defined(GIT_WIN32) && !defined(__MINGW32__) + return (entry && entry->mode) + ? S_ISDIR(entry->mode) ? GIT_DIR_FLAG_TRUE : GIT_DIR_FLAG_FALSE + : GIT_DIR_FLAG_UNKNOWN; +#else + GIT_UNUSED(entry); + return GIT_DIR_FLAG_UNKNOWN; +#endif +} + static int workdir_iterator__enter_dir(fs_iterator *fi) { workdir_iterator *wi = (workdir_iterator *)fi; fs_iterator_frame *ff = fi->stack; size_t pos; - git_path_with_stat *entry; + fs_iterator_path_with_stat *entry; bool found_submodules = false; + git_dir_flag dir_flag = git_entry__dir_flag(&fi->entry); + /* check if this directory is ignored */ - if (git_ignore__lookup( - &ff->is_ignored, &wi->ignores, fi->path.ptr + fi->root_len) < 0) { + if (git_ignore__lookup(&ff->is_ignored, &wi->ignores, fi->path.ptr + fi->root_len, dir_flag) < 0) { giterr_clear(); ff->is_ignored = GIT_IGNORE_NOTFOUND; } @@ -1481,7 +1611,6 @@ return fs_iterator__initialize(out, &wi->fi, repo_workdir); } - void git_iterator_free(git_iterator *iter) { if (iter == NULL) @@ -1572,8 +1701,9 @@ static void workdir_iterator_update_is_ignored(workdir_iterator *wi) { - if (git_ignore__lookup( - &wi->is_ignored, &wi->ignores, wi->fi.entry.path) < 0) { + git_dir_flag dir_flag = git_entry__dir_flag(&wi->fi.entry); + + if (git_ignore__lookup(&wi->is_ignored, &wi->ignores, wi->fi.entry.path, dir_flag) < 0) { giterr_clear(); wi->is_ignored = GIT_IGNORE_NOTFOUND; } @@ -1635,6 +1765,18 @@ return 0; } +int git_iterator_index(git_index **out, git_iterator *iter) +{ + workdir_iterator *wi = (workdir_iterator *)iter; + + if (iter->type != GIT_ITERATOR_TYPE_WORKDIR) + *out = NULL; + + *out = wi->index; + + return 0; +} + int git_iterator_advance_over_with_status( const git_index_entry **entryptr, git_iterator_status_t *status, @@ -1704,3 +1846,89 @@ return error; } +int git_iterator_walk( + git_iterator **iterators, + size_t cnt, + git_iterator_walk_cb cb, + void *data) +{ + const git_index_entry **iterator_item; /* next in each iterator */ + const git_index_entry **cur_items; /* current path in each iter */ + const git_index_entry *first_match; + size_t i, j; + int error = 0; + + iterator_item = git__calloc(cnt, sizeof(git_index_entry *)); + cur_items = git__calloc(cnt, sizeof(git_index_entry *)); + + GITERR_CHECK_ALLOC(iterator_item); + GITERR_CHECK_ALLOC(cur_items); + + /* Set up the iterators */ + for (i = 0; i < cnt; i++) { + error = git_iterator_current(&iterator_item[i], iterators[i]); + + if (error < 0 && error != GIT_ITEROVER) + goto done; + } + + while (true) { + for (i = 0; i < cnt; i++) + cur_items[i] = NULL; + + first_match = NULL; + + /* Find the next path(s) to consume from each iterator */ + for (i = 0; i < cnt; i++) { + if (iterator_item[i] == NULL) + continue; + + if (first_match == NULL) { + first_match = iterator_item[i]; + cur_items[i] = iterator_item[i]; + } else { + int path_diff = git_index_entry_cmp(iterator_item[i], first_match); + + if (path_diff < 0) { + /* Found an index entry that sorts before the one we're + * looking at. Forget that we've seen the other and + * look at the other iterators for this path. + */ + for (j = 0; j < i; j++) + cur_items[j] = NULL; + + first_match = iterator_item[i]; + cur_items[i] = iterator_item[i]; + } else if (path_diff == 0) { + cur_items[i] = iterator_item[i]; + } + } + } + + if (first_match == NULL) + break; + + if ((error = cb(cur_items, data)) != 0) + goto done; + + /* Advance each iterator that participated */ + for (i = 0; i < cnt; i++) { + if (cur_items[i] == NULL) + continue; + + error = git_iterator_advance(&iterator_item[i], iterators[i]); + + if (error < 0 && error != GIT_ITEROVER) + goto done; + } + } + +done: + git__free((git_index_entry **)iterator_item); + git__free((git_index_entry **)cur_items); + + if (error == GIT_ITEROVER) + error = 0; + + return error; +} diff -Nru libgit2-0.22.2/src/iterator.h libgit2-0.23.1/src/iterator.h --- libgit2-0.22.2/src/iterator.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/iterator.h 2015-08-03 18:07:35.000000000 +0000 @@ -11,6 +11,7 @@ #include "git2/index.h" #include "vector.h" #include "buffer.h" +#include "ignore.h" typedef struct git_iterator git_iterator; @@ -33,6 +34,8 @@ GIT_ITERATOR_DONT_AUTOEXPAND = (1u << 3), /** convert precomposed unicode to decomposed unicode */ GIT_ITERATOR_PRECOMPOSE_UNICODE = (1u << 4), + /** include conflicts */ + GIT_ITERATOR_INCLUDE_CONFLICTS = (1u << 5), } git_iterator_flag_t; typedef struct { @@ -284,4 +287,26 @@ extern int git_iterator_advance_over_with_status( const git_index_entry **entry, git_iterator_status_t *status, git_iterator *iter); +/** + * Retrieve the index stored in the iterator. + * + * Only implemented for the workdir iterator + */ +extern int git_iterator_index(git_index **out, git_iterator *iter); + +typedef int (*git_iterator_walk_cb)( + const git_index_entry **entries, + void *data); + +/** + * Walk the given iterators in lock-step. The given callback will be + * called for each unique path, with the index entry in each iterator + * (or NULL if the given iterator does not contain that path). + */ +extern int git_iterator_walk( + git_iterator **iterators, + size_t cnt, + git_iterator_walk_cb cb, + void *data); + #endif diff -Nru libgit2-0.22.2/src/khash.h libgit2-0.23.1/src/khash.h --- libgit2-0.22.2/src/khash.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/khash.h 2015-08-03 18:07:35.000000000 +0000 @@ -46,6 +46,19 @@ */ /* + 2013-05-02 (0.2.8): + + * Use quadratic probing. When the capacity is power of 2, stepping function + i*(i+1)/2 guarantees to traverse each bucket. It is better than double + hashing on cache performance and is more robust than linear probing. + + In theory, double hashing should be more robust than quadratic probing. + However, my implementation is probably not for large hash tables, because + the second hash function is closely tied to the first hash function, + which reduce the effectiveness of double hashing. + + Reference: http://research.cs.vt.edu/AVresearch/hashing/quadratic.php + 2011-12-29 (0.2.7): * Minor code clean up; no actual effect. @@ -110,13 +123,13 @@ Generic hash table library. */ -#define AC_VERSION_KHASH_H "0.2.6" +#define AC_VERSION_KHASH_H "0.2.8" #include #include #include -/* compipler specific configuration */ +/* compiler specific configuration */ #if UINT_MAX == 0xffffffffu typedef unsigned int khint32_t; @@ -130,11 +143,13 @@ typedef unsigned long long khint64_t; #endif +#ifndef kh_inline #ifdef _MSC_VER #define kh_inline __inline #else #define kh_inline inline #endif +#endif /* kh_inline */ typedef khint32_t khint_t; typedef khint_t khiter_t; @@ -147,12 +162,6 @@ #define __ac_set_isboth_false(flag, i) (flag[i>>4]&=~(3ul<<((i&0xfU)<<1))) #define __ac_set_isdel_true(flag, i) (flag[i>>4]|=1ul<<((i&0xfU)<<1)) -#ifdef KHASH_LINEAR -#define __ac_inc(k, m) 1 -#else -#define __ac_inc(k, m) (((k)>>3 ^ (k)<<3) | 1) & (m) -#endif - #define __ac_fsize(m) ((m) < 16? 1 : (m)>>4) #ifndef kroundup32 @@ -168,6 +177,9 @@ #ifndef krealloc #define krealloc(P,Z) realloc(P,Z) #endif +#ifndef kreallocarray +#define kreallocarray(P,N,Z) ((SIZE_MAX - N < Z) ? NULL : krealloc(P, (N*Z))) +#endif #ifndef kfree #define kfree(P) free(P) #endif @@ -175,7 +187,7 @@ static const double __ac_HASH_UPPER = 0.77; #define __KHASH_TYPE(name, khkey_t, khval_t) \ - typedef struct { \ + typedef struct kh_##name##_s { \ khint_t n_buckets, size, n_occupied, upper_bound; \ khint32_t *flags; \ khkey_t *keys; \ @@ -213,19 +225,19 @@ SCOPE khint_t kh_get_##name(const kh_##name##_t *h, khkey_t key) \ { \ if (h->n_buckets) { \ - khint_t inc, k, i, last, mask; \ + khint_t k, i, last, mask, step = 0; \ mask = h->n_buckets - 1; \ k = __hash_func(key); i = k & mask; \ - inc = __ac_inc(k, mask); last = i; /* inc==1 for linear probing */ \ + last = i; \ while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ - i = (i + inc) & mask; \ + i = (i + (++step)) & mask; \ if (i == last) return h->n_buckets; \ } \ return __ac_iseither(h->flags, i)? h->n_buckets : i; \ } else return 0; \ } \ SCOPE int kh_resize_##name(kh_##name##_t *h, khint_t new_n_buckets) \ - { /* This function uses 0.25*n_bucktes bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \ + { /* This function uses 0.25*n_buckets bytes of working space instead of [sizeof(key_t+val_t)+.25]*n_buckets. */ \ khint32_t *new_flags = 0; \ khint_t j = 1; \ { \ @@ -233,16 +245,16 @@ if (new_n_buckets < 4) new_n_buckets = 4; \ if (h->size >= (khint_t)(new_n_buckets * __ac_HASH_UPPER + 0.5)) j = 0; /* requested size is too small */ \ else { /* hash table size to be changed (shrink or expand); rehash */ \ - new_flags = (khint32_t*)kmalloc(__ac_fsize(new_n_buckets) * sizeof(khint32_t)); \ + new_flags = (khint32_t*)kreallocarray(NULL, __ac_fsize(new_n_buckets), sizeof(khint32_t)); \ if (!new_flags) return -1; \ memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(khint32_t)); \ if (h->n_buckets < new_n_buckets) { /* expand */ \ - khkey_t *new_keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \ - if (!new_keys) return -1; \ + khkey_t *new_keys = (khkey_t*)kreallocarray((void *)h->keys, new_n_buckets, sizeof(khkey_t)); \ + if (!new_keys) { kfree(new_flags); return -1; } \ h->keys = new_keys; \ if (kh_is_map) { \ - khval_t *new_vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \ - if (!new_vals) return -1; \ + khval_t *new_vals = (khval_t*)kreallocarray((void *)h->vals, new_n_buckets, sizeof(khval_t)); \ + if (!new_vals) { kfree(new_flags); return -1; } \ h->vals = new_vals; \ } \ } /* otherwise shrink */ \ @@ -258,11 +270,10 @@ if (kh_is_map) val = h->vals[j]; \ __ac_set_isdel_true(h->flags, j); \ while (1) { /* kick-out process; sort of like in Cuckoo hashing */ \ - khint_t inc, k, i; \ + khint_t k, i, step = 0; \ k = __hash_func(key); \ i = k & new_mask; \ - inc = __ac_inc(k, new_mask); \ - while (!__ac_isempty(new_flags, i)) i = (i + inc) & new_mask; \ + while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask; \ __ac_set_isempty_false(new_flags, i); \ if (i < h->n_buckets && __ac_iseither(h->flags, i) == 0) { /* kick out the existing element */ \ { khkey_t tmp = h->keys[i]; h->keys[i] = key; key = tmp; } \ @@ -277,8 +288,8 @@ } \ } \ if (h->n_buckets > new_n_buckets) { /* shrink the hash table */ \ - h->keys = (khkey_t*)krealloc((void *)h->keys, new_n_buckets * sizeof(khkey_t)); \ - if (kh_is_map) h->vals = (khval_t*)krealloc((void *)h->vals, new_n_buckets * sizeof(khval_t)); \ + h->keys = (khkey_t*)kreallocarray((void *)h->keys, new_n_buckets, sizeof(khkey_t)); \ + if (kh_is_map) h->vals = (khval_t*)kreallocarray((void *)h->vals, new_n_buckets, sizeof(khval_t)); \ } \ kfree(h->flags); /* free the working space */ \ h->flags = new_flags; \ @@ -301,14 +312,14 @@ } \ } /* TODO: to implement automatically shrinking; resize() already support shrinking */ \ { \ - khint_t inc, k, i, site, last, mask = h->n_buckets - 1; \ + khint_t k, i, site, last, mask = h->n_buckets - 1, step = 0; \ x = site = h->n_buckets; k = __hash_func(key); i = k & mask; \ if (__ac_isempty(h->flags, i)) x = i; /* for speed up */ \ else { \ - inc = __ac_inc(k, mask); last = i; \ + last = i; \ while (!__ac_isempty(h->flags, i) && (__ac_isdel(h->flags, i) || !__hash_equal(h->keys[i], key))) { \ if (__ac_isdel(h->flags, i)) site = i; \ - i = (i + inc) & mask; \ + i = (i + (++step)) & mask; \ if (i == last) { x = site; break; } \ } \ if (x == h->n_buckets) { \ @@ -449,7 +460,8 @@ @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] @param k Key [type of keys] - @param r Extra return code: 0 if the key is present in the hash table; + @param r Extra return code: -1 if the operation failed; + 0 if the key is present in the hash table; 1 if the bucket is empty (never used); 2 if the element in the bucket has been deleted [int*] @return Iterator to the inserted element [khint_t] @@ -461,7 +473,7 @@ @param name Name of the hash table [symbol] @param h Pointer to the hash table [khash_t(name)*] @param k Key [type of keys] - @return Iterator to the found element, or kh_end(h) is the element is absent [khint_t] + @return Iterator to the found element, or kh_end(h) if the element is absent [khint_t] */ #define kh_get(name, h, k) kh_get_##name(h, k) diff -Nru libgit2-0.22.2/src/merge.c libgit2-0.23.1/src/merge.c --- libgit2-0.22.2/src/merge.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/merge.c 2015-08-03 18:07:35.000000000 +0000 @@ -61,6 +61,11 @@ git_merge_diff *prev_conflict; }; +GIT_INLINE(int) merge_diff_detect_binary( + bool *binary_out, + git_repository *repo, + const git_merge_diff *conflict); + /* Merge base computation */ @@ -74,7 +79,7 @@ unsigned int i; if (length < 2) { - giterr_set(GITERR_INVALID, "At least two commits are required to find an ancestor. Provided 'length' was %u.", length); + giterr_set(GITERR_INVALID, "At least two commits are required to find an ancestor. Provided 'length' was %" PRIuZ ".", length); return -1; } @@ -180,7 +185,7 @@ assert(out && repo && input_array); if (length < 2) { - giterr_set(GITERR_INVALID, "At least two commits are required to find an ancestor. Provided 'length' was %u.", length); + giterr_set(GITERR_INVALID, "At least two commits are required to find an ancestor. Provided 'length' was %" PRIuZ ".", length); return -1; } @@ -653,7 +658,8 @@ int *resolved, git_merge_diff_list *diff_list, const git_merge_diff *conflict, - unsigned int merge_file_favor) + unsigned int merge_file_favor, + unsigned int file_flags) { const git_index_entry *ancestor = NULL, *ours = NULL, *theirs = NULL; git_merge_file_options opts = GIT_MERGE_FILE_OPTIONS_INIT; @@ -662,6 +668,7 @@ git_odb *odb = NULL; git_oid automerge_oid; int error = 0; + bool binary = false; assert(resolved && diff_list && conflict); @@ -697,7 +704,9 @@ return 0; /* Reject binary conflicts */ - if (conflict->binary) + if ((error = merge_diff_detect_binary(&binary, diff_list->repo, conflict)) < 0) + return error; + if (binary) return 0; ancestor = GIT_MERGE_INDEX_ENTRY_EXISTS(conflict->ancestor_entry) ? @@ -708,6 +717,7 @@ &conflict->their_entry : NULL; opts.favor = merge_file_favor; + opts.flags = file_flags; if ((error = git_repository_odb(&odb, diff_list->repo)) < 0 || (error = git_merge_file_from_index(&result, diff_list->repo, ancestor, ours, theirs, &opts)) < 0 || @@ -741,7 +751,8 @@ int *out, git_merge_diff_list *diff_list, const git_merge_diff *conflict, - unsigned int merge_file_favor) + unsigned int merge_file_favor, + unsigned int file_flags) { int resolved = 0; int error = 0; @@ -757,7 +768,8 @@ if (!resolved && (error = merge_conflict_resolve_one_renamed(&resolved, diff_list, conflict)) < 0) goto done; - if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, merge_file_favor)) < 0) + if (!resolved && (error = merge_conflict_resolve_automerge(&resolved, diff_list, conflict, + merge_file_favor, file_flags)) < 0) goto done; *out = resolved; @@ -1131,9 +1143,9 @@ if (GIT_MERGE_INDEX_ENTRY_EXISTS(entry->ancestor_entry) && (!GIT_MERGE_INDEX_ENTRY_EXISTS(entry->our_entry) || !GIT_MERGE_INDEX_ENTRY_EXISTS(entry->their_entry))) - src_count++; + (*src_count)++; else if (!GIT_MERGE_INDEX_ENTRY_EXISTS(entry->ancestor_entry)) - tgt_count++; + (*tgt_count)++; } } @@ -1150,7 +1162,7 @@ assert(diff_list && opts); - if ((opts->flags & GIT_MERGE_TREE_FIND_RENAMES) == 0) + if ((opts->tree_flags & GIT_MERGE_TREE_FIND_RENAMES) == 0) return 0; similarity_ours = git__calloc(diff_list->conflicts.length, @@ -1169,7 +1181,7 @@ goto done; if (diff_list->conflicts.length <= opts->target_limit) { - cache_size = diff_list->conflicts.length * 3; + GITERR_CHECK_ALLOC_MULTIPLY(&cache_size, diff_list->conflicts.length, 3); cache = git__calloc(cache_size, sizeof(void *)); GITERR_CHECK_ALLOC(cache); @@ -1303,35 +1315,39 @@ } GIT_INLINE(int) merge_diff_detect_binary( + bool *binary_out, git_repository *repo, - git_merge_diff *conflict) + const git_merge_diff *conflict) { git_blob *ancestor_blob = NULL, *our_blob = NULL, *their_blob = NULL; int error = 0; + bool binary = false; if (GIT_MERGE_INDEX_ENTRY_ISFILE(conflict->ancestor_entry)) { if ((error = git_blob_lookup(&ancestor_blob, repo, &conflict->ancestor_entry.id)) < 0) goto done; - conflict->binary = git_blob_is_binary(ancestor_blob); + binary = git_blob_is_binary(ancestor_blob); } - if (!conflict->binary && + if (!binary && GIT_MERGE_INDEX_ENTRY_ISFILE(conflict->our_entry)) { if ((error = git_blob_lookup(&our_blob, repo, &conflict->our_entry.id)) < 0) goto done; - conflict->binary = git_blob_is_binary(our_blob); + binary = git_blob_is_binary(our_blob); } - if (!conflict->binary && + if (!binary && GIT_MERGE_INDEX_ENTRY_ISFILE(conflict->their_entry)) { if ((error = git_blob_lookup(&their_blob, repo, &conflict->their_entry.id)) < 0) goto done; - conflict->binary = git_blob_is_binary(their_blob); + binary = git_blob_is_binary(their_blob); } + *binary_out = binary; + done: git_blob_free(ancestor_blob); git_blob_free(our_blob); @@ -1411,7 +1427,6 @@ if ((conflict = merge_diff_from_index_entries(diff_list, tree_items)) == NULL || merge_diff_detect_type(conflict) < 0 || merge_diff_detect_df_conflict(merge_df_data, conflict) < 0 || - merge_diff_detect_binary(diff_list->repo, conflict) < 0 || git_vector_insert(&diff_list->conflicts, conflict) < 0) return -1; @@ -1434,108 +1449,44 @@ return error; } -int git_merge_diff_list__find_differences( - git_merge_diff_list *diff_list, - const git_tree *ancestor_tree, - const git_tree *our_tree, - const git_tree *their_tree) -{ - git_iterator *iterators[3] = {0}; - const git_index_entry *items[3] = {0}, *best_cur_item, *cur_items[3]; - git_vector_cmp entry_compare = git_index_entry_cmp; - struct merge_diff_df_data df_data = {0}; - int cur_item_modified; - size_t i, j; - int error = 0; - - assert(diff_list && (our_tree || their_tree)); - - if ((error = git_iterator_for_tree(&iterators[TREE_IDX_ANCESTOR], (git_tree *)ancestor_tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_tree(&iterators[TREE_IDX_OURS], (git_tree *)our_tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || - (error = git_iterator_for_tree(&iterators[TREE_IDX_THEIRS], (git_tree *)their_tree, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) - goto done; - - /* Set up the iterators */ - for (i = 0; i < 3; i++) { - error = git_iterator_current(&items[i], iterators[i]); - - if (error < 0 && error != GIT_ITEROVER) - goto done; - } - - while (true) { - for (i = 0; i < 3; i++) - cur_items[i] = NULL; - - best_cur_item = NULL; - cur_item_modified = 0; - - /* Find the next path(s) to consume from each iterator */ - for (i = 0; i < 3; i++) { - if (items[i] == NULL) { - cur_item_modified = 1; - continue; - } +struct merge_diff_find_data { + git_merge_diff_list *diff_list; + struct merge_diff_df_data df_data; +}; - if (best_cur_item == NULL) { - best_cur_item = items[i]; - cur_items[i] = items[i]; - } else { - int path_diff = entry_compare(items[i], best_cur_item); - - if (path_diff < 0) { - /* - * Found an item that sorts before our current item, make - * our current item this one. - */ - for (j = 0; j < i; j++) - cur_items[j] = NULL; - - cur_item_modified = 1; - best_cur_item = items[i]; - cur_items[i] = items[i]; - } else if (path_diff > 0) { - /* No entry for the current item, this is modified */ - cur_item_modified = 1; - } else if (path_diff == 0) { - cur_items[i] = items[i]; +static int queue_difference(const git_index_entry **entries, void *data) +{ + struct merge_diff_find_data *find_data = data; + bool item_modified = false; + size_t i; - if (!cur_item_modified) - cur_item_modified = index_entry_cmp(best_cur_item, items[i]); - } + if (!entries[0] || !entries[1] || !entries[2]) { + item_modified = true; + } else { + for (i = 1; i < 3; i++) { + if (index_entry_cmp(entries[0], entries[i]) != 0) { + item_modified = true; + break; } } - - if (best_cur_item == NULL) - break; - - if (cur_item_modified) - error = merge_diff_list_insert_conflict(diff_list, &df_data, cur_items); - else - error = merge_diff_list_insert_unmodified(diff_list, cur_items); - if (error < 0) - goto done; - - /* Advance each iterator that participated */ - for (i = 0; i < 3; i++) { - if (cur_items[i] == NULL) - continue; - - error = git_iterator_advance(&items[i], iterators[i]); - - if (error < 0 && error != GIT_ITEROVER) - goto done; - } } -done: - for (i = 0; i < 3; i++) - git_iterator_free(iterators[i]); + return item_modified ? + merge_diff_list_insert_conflict( + find_data->diff_list, &find_data->df_data, entries) : + merge_diff_list_insert_unmodified(find_data->diff_list, entries); +} - if (error == GIT_ITEROVER) - error = 0; +int git_merge_diff_list__find_differences( + git_merge_diff_list *diff_list, + git_iterator *ancestor_iter, + git_iterator *our_iter, + git_iterator *their_iter) +{ + git_iterator *iterators[3] = { ancestor_iter, our_iter, their_iter }; + struct merge_diff_find_data find_data = { diff_list }; - return error; + return git_iterator_walk(iterators, 3, queue_difference, &find_data); } git_merge_diff_list *git_merge_diff_list__alloc(git_repository *repo) @@ -1589,7 +1540,7 @@ git_merge_options init = GIT_MERGE_OPTIONS_INIT; memcpy(opts, &init, sizeof(init)); - opts->flags = GIT_MERGE_TREE_FIND_RENAMES; + opts->tree_flags = GIT_MERGE_TREE_FIND_RENAMES; opts->rename_threshold = GIT_MERGE_TREE_RENAME_THRESHOLD; } @@ -1612,13 +1563,7 @@ opts->metric->buffer_signature = git_diff_find_similar__hashsig_for_buf; opts->metric->free_signature = git_diff_find_similar__hashsig_free; opts->metric->similarity = git_diff_find_similar__calc_similarity; - - if (opts->flags & GIT_DIFF_FIND_IGNORE_WHITESPACE) - opts->metric->payload = (void *)GIT_HASHSIG_IGNORE_WHITESPACE; - else if (opts->flags & GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE) - opts->metric->payload = (void *)GIT_HASHSIG_NORMAL; - else - opts->metric->payload = (void *)GIT_HASHSIG_SMART_WHITESPACE; + opts->metric->payload = (void *)GIT_HASHSIG_SMART_WHITESPACE; } return 0; @@ -1748,14 +1693,28 @@ return error; } -int git_merge_trees( +static git_iterator *iterator_given_or_empty(git_iterator **empty, git_iterator *given) +{ + if (given) + return given; + + if (git_iterator_for_nothing(empty, GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL) < 0) + return NULL; + + return *empty; +} + +int git_merge__iterators( git_index **out, git_repository *repo, - const git_tree *ancestor_tree, - const git_tree *our_tree, - const git_tree *their_tree, + git_iterator *ancestor_iter, + git_iterator *our_iter, + git_iterator *theirs_iter, const git_merge_options *given_opts) { + git_iterator *empty_ancestor = NULL, + *empty_ours = NULL, + *empty_theirs = NULL; git_merge_diff_list *diff_list; git_merge_options opts; git_merge_diff *conflict; @@ -1763,11 +1722,12 @@ size_t i; int error = 0; - assert(out && repo && (our_tree || their_tree)); + assert(out && repo); *out = NULL; - GITERR_CHECK_VERSION(given_opts, GIT_MERGE_OPTIONS_VERSION, "git_merge_options"); + GITERR_CHECK_VERSION( + given_opts, GIT_MERGE_OPTIONS_VERSION, "git_merge_options"); if ((error = merge_normalize_opts(repo, &opts, given_opts)) < 0) return error; @@ -1775,7 +1735,12 @@ diff_list = git_merge_diff_list__alloc(repo); GITERR_CHECK_ALLOC(diff_list); - if ((error = git_merge_diff_list__find_differences(diff_list, ancestor_tree, our_tree, their_tree)) < 0 || + ancestor_iter = iterator_given_or_empty(&empty_ancestor, ancestor_iter); + our_iter = iterator_given_or_empty(&empty_ours, our_iter); + theirs_iter = iterator_given_or_empty(&empty_theirs, theirs_iter); + + if ((error = git_merge_diff_list__find_differences( + diff_list, ancestor_iter, our_iter, theirs_iter)) < 0 || (error = git_merge_diff_list__find_renames(repo, diff_list, &opts)) < 0) goto done; @@ -1785,7 +1750,7 @@ git_vector_foreach(&changes, i, conflict) { int resolved = 0; - if ((error = merge_conflict_resolve(&resolved, diff_list, conflict, opts.file_favor)) < 0) + if ((error = merge_conflict_resolve(&resolved, diff_list, conflict, opts.file_favor, opts.file_flags)) < 0) goto done; if (!resolved) @@ -1799,10 +1764,44 @@ done: git_merge_diff_list__free(diff_list); + git_iterator_free(empty_ancestor); + git_iterator_free(empty_ours); + git_iterator_free(empty_theirs); return error; } +int git_merge_trees( + git_index **out, + git_repository *repo, + const git_tree *ancestor_tree, + const git_tree *our_tree, + const git_tree *their_tree, + const git_merge_options *merge_opts) +{ + git_iterator *ancestor_iter = NULL, *our_iter = NULL, *their_iter = NULL; + int error; + + if ((error = git_iterator_for_tree(&ancestor_iter, (git_tree *)ancestor_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || + (error = git_iterator_for_tree(&our_iter, (git_tree *)our_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || + (error = git_iterator_for_tree(&their_iter, (git_tree *)their_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) + goto done; + + error = git_merge__iterators( + out, repo, ancestor_iter, our_iter, their_iter, merge_opts); + +done: + git_iterator_free(ancestor_iter); + git_iterator_free(our_iter); + git_iterator_free(their_iter); + + return error; +} + + int git_merge_commits( git_index **out, git_repository *repo, @@ -2229,12 +2228,13 @@ size_t their_heads_len) { git_oid *oids, ancestor_oid; - size_t i; + size_t i, alloc_len; int error = 0; assert(repo && our_head && their_heads); - oids = git__calloc(their_heads_len + 1, sizeof(git_oid)); + GITERR_CHECK_ALLOC_ADD(&alloc_len, their_heads_len, 1); + oids = git__calloc(alloc_len, sizeof(git_oid)); GITERR_CHECK_ALLOC(oids); git_oid_cpy(&oids[0], git_commit_id(our_head->commit)); @@ -2436,7 +2436,7 @@ for (i = 0; i < git_index_entrycount(index_new); i++) { e = git_index_get_byindex(index_new, i); - if (git_index_entry_stage(e) != 0 && + if (git_index_entry_is_conflict(e) && (git_vector_last(&paths) == NULL || strcmp(git_vector_last(&paths), e->path) != 0)) { @@ -2451,9 +2451,9 @@ goto done; if ((conflicts = index_conflicts + wd_conflicts) > 0) { - giterr_set(GITERR_MERGE, "%d uncommitted change%s would be overwritten by merge", + giterr_set(GITERR_MERGE, "%" PRIuZ " uncommitted change%s would be overwritten by merge", conflicts, (conflicts != 1) ? "s" : ""); - error = GIT_EMERGECONFLICT; + error = GIT_ECONFLICT; } done: @@ -2488,7 +2488,7 @@ for (i = 0; i < git_index_entrycount(index); i++) { const git_index_entry *e = git_index_get_byindex(index, i); - if (git_index_entry_stage(e) == 0) + if (!git_index_entry_is_conflict(e)) continue; if (last == NULL || strcmp(e->path, last) != 0) @@ -2657,7 +2657,8 @@ git_checkout_options checkout_opts; git_annotated_commit *ancestor_head = NULL, *our_head = NULL; git_tree *ancestor_tree = NULL, *our_tree = NULL, **their_trees = NULL; - git_index *index_new = NULL; + git_index *index = NULL; + git_indexwriter indexwriter = GIT_INDEXWRITER_INIT; size_t i; int error = 0; @@ -2671,11 +2672,10 @@ their_trees = git__calloc(their_heads_len, sizeof(git_tree *)); GITERR_CHECK_ALLOC(their_trees); - if ((error = merge_heads(&ancestor_head, &our_head, repo, their_heads, their_heads_len)) < 0) - goto on_error; - - if ((error = merge_normalize_checkout_opts(repo, &checkout_opts, given_checkout_opts, - ancestor_head, our_head, their_heads_len, their_heads)) < 0) + if ((error = merge_heads(&ancestor_head, &our_head, repo, their_heads, their_heads_len)) < 0 || + (error = merge_normalize_checkout_opts(repo, &checkout_opts, given_checkout_opts, + ancestor_head, our_head, their_heads_len, their_heads)) < 0 || + (error = git_indexwriter_init_for_operation(&indexwriter, repo, &checkout_opts.checkout_strategy)) < 0) goto on_error; /* Write the merge files to the repository. */ @@ -2696,10 +2696,11 @@ /* TODO: recursive, octopus, etc... */ - if ((error = git_merge_trees(&index_new, repo, ancestor_tree, our_tree, their_trees[0], merge_opts)) < 0 || - (error = git_merge__check_result(repo, index_new)) < 0 || - (error = git_merge__append_conflicts_to_merge_msg(repo, index_new)) < 0 || - (error = git_checkout_index(repo, index_new, &checkout_opts)) < 0) + if ((error = git_merge_trees(&index, repo, ancestor_tree, our_tree, their_trees[0], merge_opts)) < 0 || + (error = git_merge__check_result(repo, index)) < 0 || + (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 || + (error = git_checkout_index(repo, index, &checkout_opts)) < 0 || + (error = git_indexwriter_commit(&indexwriter)) < 0) goto on_error; goto done; @@ -2708,7 +2709,9 @@ merge_state_cleanup(repo); done: - git_index_free(index_new); + git_indexwriter_cleanup(&indexwriter); + + git_index_free(index); git_tree_free(ancestor_tree); git_tree_free(our_tree); diff -Nru libgit2-0.22.2/src/merge_file.c libgit2-0.23.1/src/merge_file.c --- libgit2-0.22.2/src/merge_file.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/merge_file.c 2015-08-03 18:07:35.000000000 +0000 @@ -151,6 +151,19 @@ if (options.flags & GIT_MERGE_FILE_STYLE_DIFF3) xmparam.style = XDL_MERGE_DIFF3; + if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE) + xmparam.xpp.flags |= XDF_IGNORE_WHITESPACE; + if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE) + xmparam.xpp.flags |= XDF_IGNORE_WHITESPACE_CHANGE; + if (options.flags & GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL) + xmparam.xpp.flags |= XDF_IGNORE_WHITESPACE_AT_EOL; + + if (options.flags & GIT_MERGE_FILE_DIFF_PATIENCE) + xmparam.xpp.flags |= XDF_PATIENCE_DIFF; + + if (options.flags & GIT_MERGE_FILE_DIFF_MINIMAL) + xmparam.xpp.flags |= XDF_NEED_MINIMAL; + if ((xdl_result = xdl_merge(&ancestor_mmfile, &our_mmfile, &their_mmfile, &xmparam, &mmbuffer)) < 0) { giterr_set(GITERR_MERGE, "Failed to merge files."); diff -Nru libgit2-0.22.2/src/merge.h libgit2-0.23.1/src/merge.h --- libgit2-0.22.2/src/merge.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/merge.h 2015-08-03 18:07:35.000000000 +0000 @@ -10,6 +10,7 @@ #include "vector.h" #include "commit_list.h" #include "pool.h" +#include "iterator.h" #include "git2/merge.h" #include "git2/types.h" @@ -107,7 +108,6 @@ git_index_entry their_entry; git_delta_t their_status; - int binary:1; } git_merge_diff; int git_merge__bases_many( @@ -122,10 +122,11 @@ git_merge_diff_list *git_merge_diff_list__alloc(git_repository *repo); -int git_merge_diff_list__find_differences(git_merge_diff_list *merge_diff_list, - const git_tree *ancestor_tree, - const git_tree *ours_tree, - const git_tree *theirs_tree); +int git_merge_diff_list__find_differences( + git_merge_diff_list *merge_diff_list, + git_iterator *ancestor_iterator, + git_iterator *ours_iter, + git_iterator *theirs_iter); int git_merge_diff_list__find_renames(git_repository *repo, git_merge_diff_list *merge_diff_list, const git_merge_options *opts); @@ -139,6 +140,14 @@ const git_annotated_commit *heads[], size_t heads_len); +int git_merge__iterators( + git_index **out, + git_repository *repo, + git_iterator *ancestor_iter, + git_iterator *our_iter, + git_iterator *their_iter, + const git_merge_options *given_opts); + int git_merge__check_result(git_repository *repo, git_index *index_new); int git_merge__append_conflicts_to_merge_msg(git_repository *repo, git_index *index); diff -Nru libgit2-0.22.2/src/mwindow.c libgit2-0.23.1/src/mwindow.c --- libgit2-0.22.2/src/mwindow.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/mwindow.c 2015-08-03 18:07:35.000000000 +0000 @@ -14,7 +14,7 @@ #include "strmap.h" #include "pack.h" -GIT__USE_STRMAP; +GIT__USE_STRMAP #define DEFAULT_WINDOW_SIZE \ (sizeof(void*) >= 8 \ diff -Nru libgit2-0.22.2/src/netops.c libgit2-0.23.1/src/netops.c --- libgit2-0.22.2/src/netops.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/netops.c 2015-08-03 18:07:35.000000000 +0000 @@ -84,7 +84,7 @@ int gitno__match_host(const char *pattern, const char *host) { for (;;) { - char c = tolower(*pattern++); + char c = git__tolower(*pattern++); if (c == '\0') return *host ? -1 : 0; @@ -102,7 +102,7 @@ */ while(*host) { - char h = tolower(*host); + char h = git__tolower(*host); if (c == h) return gitno__match_host(pattern, host++); if (h == '.') @@ -112,7 +112,7 @@ return -1; } - if (c != tolower(*host++)) + if (c != git__tolower(*host++)) return -1; } diff -Nru libgit2-0.22.2/src/netops.h libgit2-0.23.1/src/netops.h --- libgit2-0.22.2/src/netops.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/netops.h 2015-08-03 18:07:35.000000000 +0000 @@ -11,12 +11,12 @@ #include "common.h" #include "stream.h" -#ifdef GIT_SSL +#ifdef GIT_OPENSSL # include #endif typedef struct gitno_ssl { -#ifdef GIT_SSL +#ifdef GIT_OPENSSL SSL *ssl; #else size_t dummy; diff -Nru libgit2-0.22.2/src/notes.c libgit2-0.23.1/src/notes.c --- libgit2-0.22.2/src/notes.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/notes.c 2015-08-03 18:07:35.000000000 +0000 @@ -314,7 +314,7 @@ { git_note *note = NULL; - note = (git_note *)git__malloc(sizeof(git_note)); + note = git__malloc(sizeof(git_note)); GITERR_CHECK_ALLOC(note); git_oid_cpy(¬e->id, note_oid); @@ -388,7 +388,7 @@ return error; } -static int note_get_default_ref(const char **out, git_repository *repo) +static int note_get_default_ref(char **out, git_repository *repo) { git_config *cfg; int ret = git_repository_config__weakptr(&cfg, repo); @@ -399,27 +399,31 @@ return ret; } -static int normalize_namespace(const char **notes_ref, git_repository *repo) +static int normalize_namespace(char **out, git_repository *repo, const char *notes_ref) { - if (*notes_ref) + if (notes_ref) { + *out = git__strdup(notes_ref); + GITERR_CHECK_ALLOC(*out); return 0; + } - return note_get_default_ref(notes_ref, repo); + return note_get_default_ref(out, repo); } static int retrieve_note_tree_and_commit( git_tree **tree_out, git_commit **commit_out, + char **notes_ref_out, git_repository *repo, - const char **notes_ref) + const char *notes_ref) { int error; git_oid oid; - if ((error = normalize_namespace(notes_ref, repo)) < 0) + if ((error = normalize_namespace(notes_ref_out, repo, notes_ref)) < 0) return error; - if ((error = git_reference_name_to_id(&oid, repo, *notes_ref)) < 0) + if ((error = git_reference_name_to_id(&oid, repo, *notes_ref_out)) < 0) return error; if (git_commit_lookup(commit_out, repo, &oid) < 0) @@ -432,10 +436,10 @@ } int git_note_read(git_note **out, git_repository *repo, - const char *notes_ref, const git_oid *oid) + const char *notes_ref_in, const git_oid *oid) { int error; - char *target = NULL; + char *target = NULL, *notes_ref = NULL; git_tree *tree = NULL; git_commit *commit = NULL; @@ -443,9 +447,10 @@ GITERR_CHECK_ALLOC(target); if (!(error = retrieve_note_tree_and_commit( - &tree, &commit, repo, ¬es_ref))) + &tree, &commit, ¬es_ref, repo, notes_ref_in))) error = note_lookup(out, repo, commit, tree, target); + git__free(notes_ref); git__free(target); git_tree_free(tree); git_commit_free(commit); @@ -455,7 +460,7 @@ int git_note_create( git_oid *out, git_repository *repo, - const char *notes_ref, + const char *notes_ref_in, const git_signature *author, const git_signature *committer, const git_oid *oid, @@ -463,14 +468,14 @@ int allow_note_overwrite) { int error; - char *target = NULL; + char *target = NULL, *notes_ref = NULL; git_commit *commit = NULL; git_tree *tree = NULL; target = git_oid_allocfmt(oid); GITERR_CHECK_ALLOC(target); - error = retrieve_note_tree_and_commit(&tree, &commit, repo, ¬es_ref); + error = retrieve_note_tree_and_commit(&tree, &commit, ¬es_ref, repo, notes_ref_in); if (error < 0 && error != GIT_ENOTFOUND) goto cleanup; @@ -479,18 +484,19 @@ note, tree, target, &commit, allow_note_overwrite); cleanup: + git__free(notes_ref); git__free(target); git_commit_free(commit); git_tree_free(tree); return error; } -int git_note_remove(git_repository *repo, const char *notes_ref, +int git_note_remove(git_repository *repo, const char *notes_ref_in, const git_signature *author, const git_signature *committer, const git_oid *oid) { int error; - char *target = NULL; + char *target = NULL, *notes_ref; git_commit *commit = NULL; git_tree *tree = NULL; @@ -498,20 +504,31 @@ GITERR_CHECK_ALLOC(target); if (!(error = retrieve_note_tree_and_commit( - &tree, &commit, repo, ¬es_ref))) + &tree, &commit, ¬es_ref, repo, notes_ref_in))) error = note_remove( repo, author, committer, notes_ref, tree, target, &commit); + git__free(notes_ref); git__free(target); git_commit_free(commit); git_tree_free(tree); return error; } -int git_note_default_ref(const char **out, git_repository *repo) +int git_note_default_ref(git_buf *out, git_repository *repo) { - assert(repo); - return note_get_default_ref(out, repo); + char *default_ref; + int error; + + assert(out && repo); + + git_buf_sanitize(out); + + if ((error = note_get_default_ref(&default_ref, repo)) < 0) + return error; + + git_buf_attach(out, default_ref, strlen(default_ref)); + return 0; } const git_signature *git_note_committer(const git_note *note) @@ -635,13 +652,14 @@ int git_note_iterator_new( git_note_iterator **it, git_repository *repo, - const char *notes_ref) + const char *notes_ref_in) { int error; git_commit *commit = NULL; git_tree *tree = NULL; + char *notes_ref; - error = retrieve_note_tree_and_commit(&tree, &commit, repo, ¬es_ref); + error = retrieve_note_tree_and_commit(&tree, &commit, ¬es_ref, repo, notes_ref_in); if (error < 0) goto cleanup; @@ -649,6 +667,7 @@ git_iterator_free(*it); cleanup: + git__free(notes_ref); git_tree_free(tree); git_commit_free(commit); diff -Nru libgit2-0.22.2/src/odb.c libgit2-0.23.1/src/odb.c --- libgit2-0.22.2/src/odb.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/odb.c 2015-08-03 18:07:35.000000000 +0000 @@ -21,9 +21,12 @@ #define GIT_ALTERNATES_FILE "info/alternates" -/* TODO: is this correct? */ -#define GIT_LOOSE_PRIORITY 2 -#define GIT_PACKED_PRIORITY 1 +/* + * We work under the assumption that most objects for long-running + * operations will be packed + */ +#define GIT_LOOSE_PRIORITY 1 +#define GIT_PACKED_PRIORITY 2 #define GIT_ALTERNATES_MAX_DEPTH 5 @@ -47,10 +50,10 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_depth); -int git_odb__format_object_header(char *hdr, size_t n, size_t obj_len, git_otype obj_type) +int git_odb__format_object_header(char *hdr, size_t n, git_off_t obj_len, git_otype obj_type) { const char *type_str = git_object_type2string(obj_type); - int len = p_snprintf(hdr, n, "%s %"PRIuZ, type_str, obj_len); + int len = p_snprintf(hdr, n, "%s %lld", type_str, (long long)obj_len); assert(len > 0 && len <= (int)n); return len+1; } @@ -142,7 +145,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_otype type) { int hdr_len; - char hdr[64], buffer[2048]; + char hdr[64], buffer[FILEIO_BUFSIZE]; git_hash_ctx ctx; ssize_t read_len = 0; int error = 0; @@ -216,41 +219,43 @@ int git_odb__hashlink(git_oid *out, const char *path) { struct stat st; - git_off_t size; + int size; int result; if (git_path_lstat(path, &st) < 0) return -1; - size = st.st_size; - - if (!git__is_sizet(size)) { - giterr_set(GITERR_OS, "File size overflow for 32-bit systems"); + if (!git__is_int(st.st_size) || (int)st.st_size < 0) { + giterr_set(GITERR_FILESYSTEM, "File size overflow for 32-bit systems"); return -1; } + size = (int)st.st_size; + if (S_ISLNK(st.st_mode)) { char *link_data; - ssize_t read_len; + int read_len; + size_t alloc_size; - link_data = git__malloc((size_t)(size + 1)); + GITERR_CHECK_ALLOC_ADD(&alloc_size, size, 1); + link_data = git__malloc(alloc_size); GITERR_CHECK_ALLOC(link_data); - read_len = p_readlink(path, link_data, (size_t)size); + read_len = p_readlink(path, link_data, size); link_data[size] = '\0'; - if (read_len != (ssize_t)size) { + if (read_len != size) { giterr_set(GITERR_OS, "Failed to read symlink data for '%s'", path); git__free(link_data); return -1; } - result = git_odb_hash(out, link_data, (size_t)size, GIT_OBJ_BLOB); + result = git_odb_hash(out, link_data, size, GIT_OBJ_BLOB); git__free(link_data); } else { int fd = git_futils_open_ro(path); if (fd < 0) return -1; - result = git_odb__hashfd(out, fd, (size_t)size, GIT_OBJ_BLOB); + result = git_odb__hashfd(out, fd, size, GIT_OBJ_BLOB); p_close(fd); } @@ -325,10 +330,15 @@ git__free(stream); } -static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, size_t size, git_otype type) +static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, git_off_t size, git_otype type) { fake_wstream *stream; + if (!git__is_ssizet(size)) { + giterr_set(GITERR_ODB, "object size too large to keep in memory"); + return -1; + } + stream = git__calloc(1, sizeof(fake_wstream)); GITERR_CHECK_ALLOC(stream); @@ -935,7 +945,7 @@ return error; } -static void hash_header(git_hash_ctx *ctx, size_t size, git_otype type) +static void hash_header(git_hash_ctx *ctx, git_off_t size, git_otype type) { char header[64]; int hdrlen; @@ -945,7 +955,7 @@ } int git_odb_open_wstream( - git_odb_stream **stream, git_odb *db, size_t size, git_otype type) + git_odb_stream **stream, git_odb *db, git_off_t size, git_otype type) { size_t i, writes = 0; int error = GIT_ERROR; diff -Nru libgit2-0.22.2/src/odb.h libgit2-0.23.1/src/odb.h --- libgit2-0.22.2/src/odb.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/odb.h 2015-08-03 18:07:35.000000000 +0000 @@ -49,7 +49,7 @@ /* * Format the object header such as it would appear in the on-disk object */ -int git_odb__format_object_header(char *hdr, size_t n, size_t obj_len, git_otype obj_type); +int git_odb__format_object_header(char *hdr, size_t n, git_off_t obj_len, git_otype obj_type); /* * Hash an open file descriptor. * This is a performance call when the contents of a fd need to be hashed, diff -Nru libgit2-0.22.2/src/odb_loose.c libgit2-0.23.1/src/odb_loose.c --- libgit2-0.22.2/src/odb_loose.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/odb_loose.c 2015-08-03 18:07:35.000000000 +0000 @@ -63,8 +63,12 @@ static int object_file_name( git_buf *name, const loose_backend *be, const git_oid *id) { + size_t alloclen; + /* expand length for object root + 40 hex sha1 chars + 2 * '/' + '\0' */ - if (git_buf_grow(name, be->objects_dirlen + GIT_OID_HEXSZ + 3) < 0) + GITERR_CHECK_ALLOC_ADD(&alloclen, be->objects_dirlen, GIT_OID_HEXSZ); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 3); + if (git_buf_grow(name, alloclen) < 0) return -1; git_buf_set(name, be->objects_dir, be->objects_dirlen); @@ -261,14 +265,15 @@ static void *inflate_tail(z_stream *s, void *hb, size_t used, obj_hdr *hdr) { unsigned char *buf, *head = hb; - size_t tail; + size_t tail, alloc_size; /* * allocate a buffer to hold the inflated data and copy the * initial sequence of inflated data from the tail of the * head buffer, if any. */ - if ((buf = git__malloc(hdr->size + 1)) == NULL) { + if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, hdr->size, 1) || + (buf = git__malloc(alloc_size)) == NULL) { inflateEnd(s); return NULL; } @@ -306,7 +311,7 @@ { unsigned char *in, *buf; obj_hdr hdr; - size_t len, used; + size_t len, used, alloclen; /* * read the object header, which is an (uncompressed) @@ -321,7 +326,8 @@ /* * allocate a buffer and inflate the data into it */ - buf = git__malloc(hdr.size + 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, hdr.size, 1); + buf = git__malloc(alloclen); GITERR_CHECK_ALLOC(buf); in = ((unsigned char *)obj->ptr) + used; @@ -515,12 +521,14 @@ size_t len) { char *objects_dir = backend->objects_dir; - size_t dir_len = strlen(objects_dir); + size_t dir_len = strlen(objects_dir), alloc_len; loose_locate_object_state state; int error; /* prealloc memory for OBJ_DIR/xx/xx..38x..xx */ - if (git_buf_grow(object_location, dir_len + 3 + GIT_OID_HEXSZ) < 0) + GITERR_CHECK_ALLOC_ADD(&alloc_len, dir_len, GIT_OID_HEXSZ); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 3); + if (git_buf_grow(object_location, alloc_len) < 0) return -1; git_buf_set(object_location, objects_dir, dir_len); @@ -563,9 +571,11 @@ return error; /* Update the location according to the oid obtained */ + GITERR_CHECK_ALLOC_ADD(&alloc_len, dir_len, GIT_OID_HEXSZ); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2); git_buf_truncate(object_location, dir_len); - if (git_buf_grow(object_location, dir_len + GIT_OID_HEXSZ + 2) < 0) + if (git_buf_grow(object_location, alloc_len) < 0) return -1; git_oid_pathfmt(object_location->ptr + dir_len, res_oid); @@ -824,7 +834,7 @@ git__free(stream); } -static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_backend, size_t length, git_otype type) +static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_backend, git_off_t length, git_otype type) { loose_backend *backend; loose_writestream *stream = NULL; @@ -832,7 +842,7 @@ git_buf tmp_path = GIT_BUF_INIT; int hdrlen; - assert(_backend); + assert(_backend && length >= 0); backend = (loose_backend *)_backend; *stream_out = NULL; @@ -922,13 +932,15 @@ unsigned int file_mode) { loose_backend *backend; - size_t objects_dirlen; + size_t objects_dirlen, alloclen; assert(backend_out && objects_dir); objects_dirlen = strlen(objects_dir); - backend = git__calloc(1, sizeof(loose_backend) + objects_dirlen + 2); + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(loose_backend), objects_dirlen); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 2); + backend = git__calloc(1, alloclen); GITERR_CHECK_ALLOC(backend); backend->parent.version = GIT_ODB_BACKEND_VERSION; diff -Nru libgit2-0.22.2/src/odb_mempack.c libgit2-0.23.1/src/odb_mempack.c --- libgit2-0.22.2/src/odb_mempack.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/odb_mempack.c 2015-08-03 18:07:35.000000000 +0000 @@ -18,7 +18,7 @@ #include "git2/types.h" #include "git2/pack.h" -GIT__USE_OIDMAP; +GIT__USE_OIDMAP struct memobject { git_oid oid; @@ -38,6 +38,7 @@ struct memory_packer_db *db = (struct memory_packer_db *)_backend; struct memobject *obj = NULL; khiter_t pos; + size_t alloc_len; int rval; pos = kh_put(oid, db->objects, oid, &rval); @@ -47,7 +48,8 @@ if (rval == 0) return 0; - obj = git__malloc(sizeof(struct memobject) + len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(struct memobject), len); + obj = git__malloc(alloc_len); GITERR_CHECK_ALLOC(obj); memcpy(obj->data, data, len); diff -Nru libgit2-0.22.2/src/odb_pack.c libgit2-0.23.1/src/odb_pack.c --- libgit2-0.22.2/src/odb_pack.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/odb_pack.c 2015-08-03 18:07:35.000000000 +0000 @@ -383,7 +383,7 @@ git_odb_backend *backend, const git_oid *oid) { struct git_pack_entry e; - git_rawobj raw; + git_rawobj raw = {NULL}; int error; if ((error = pack_entry_find(&e, (struct pack_backend *)backend, oid)) < 0 || diff -Nru libgit2-0.22.2/src/offmap.h libgit2-0.23.1/src/offmap.h --- libgit2-0.22.2/src/offmap.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/offmap.h 2015-08-03 18:07:35.000000000 +0000 @@ -13,14 +13,15 @@ #define kmalloc git__malloc #define kcalloc git__calloc #define krealloc git__realloc +#define kreallocarray git__reallocarray #define kfree git__free #include "khash.h" -__KHASH_TYPE(off, git_off_t, void *); +__KHASH_TYPE(off, git_off_t, void *) typedef khash_t(off) git_offmap; #define GIT__USE_OFFMAP \ - __KHASH_IMPL(off, static kh_inline, git_off_t, void *, 1, kh_int64_hash_func, kh_int64_hash_equal); + __KHASH_IMPL(off, static kh_inline, git_off_t, void *, 1, kh_int64_hash_func, kh_int64_hash_equal) #define git_offmap_alloc() kh_init(off) #define git_offmap_free(h) kh_destroy(off, h), h = NULL diff -Nru libgit2-0.22.2/src/oid.c libgit2-0.23.1/src/oid.c --- libgit2-0.22.2/src/oid.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/oid.c 2015-08-03 18:07:35.000000000 +0000 @@ -261,7 +261,7 @@ static int resize_trie(git_oid_shorten *self, size_t new_size) { - self->nodes = git__realloc(self->nodes, new_size * sizeof(trie_node)); + self->nodes = git__reallocarray(self->nodes, new_size, sizeof(trie_node)); GITERR_CHECK_ALLOC(self->nodes); if (new_size > self->size) { diff -Nru libgit2-0.22.2/src/oidmap.h libgit2-0.23.1/src/oidmap.h --- libgit2-0.22.2/src/oidmap.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/oidmap.h 2015-08-03 18:07:35.000000000 +0000 @@ -13,10 +13,11 @@ #define kmalloc git__malloc #define kcalloc git__calloc #define krealloc git__realloc +#define kreallocarray git__reallocarray #define kfree git__free #include "khash.h" -__KHASH_TYPE(oid, const git_oid *, void *); +__KHASH_TYPE(oid, const git_oid *, void *) typedef khash_t(oid) git_oidmap; GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid) diff -Nru libgit2-0.22.2/src/openssl_stream.c libgit2-0.23.1/src/openssl_stream.c --- libgit2-0.22.2/src/openssl_stream.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/openssl_stream.c 2015-08-03 18:07:35.000000000 +0000 @@ -5,12 +5,9 @@ * a Linking Exception. For full terms see the included COPYING file. */ -#ifdef GIT_SSL +#ifdef GIT_OPENSSL #include -#include -#include -#include #include "global.h" #include "posix.h" @@ -19,9 +16,92 @@ #include "netops.h" #include "git2/transport.h" +#ifdef GIT_CURL +# include "curl_stream.h" +#endif + +#ifndef GIT_WIN32 +# include +# include +# include +#endif + #include #include #include +#include + +static int bio_create(BIO *b) +{ + b->init = 1; + b->num = 0; + b->ptr = NULL; + b->flags = 0; + + return 1; +} + +static int bio_destroy(BIO *b) +{ + if (!b) + return 0; + + b->init = 0; + b->num = 0; + b->ptr = NULL; + b->flags = 0; + + return 1; +} + +static int bio_read(BIO *b, char *buf, int len) +{ + git_stream *io = (git_stream *) b->ptr; + return (int) git_stream_read(io, buf, len); +} + +static int bio_write(BIO *b, const char *buf, int len) +{ + git_stream *io = (git_stream *) b->ptr; + return (int) git_stream_write(io, buf, len, 0); +} + +static long bio_ctrl(BIO *b, int cmd, long num, void *ptr) +{ + GIT_UNUSED(b); + GIT_UNUSED(num); + GIT_UNUSED(ptr); + + if (cmd == BIO_CTRL_FLUSH) + return 1; + + return 0; +} + +static int bio_gets(BIO *b, char *buf, int len) +{ + GIT_UNUSED(b); + GIT_UNUSED(buf); + GIT_UNUSED(len); + return -1; +} + +static int bio_puts(BIO *b, const char *str) +{ + return bio_write(b, str, strlen(str)); +} + +static BIO_METHOD git_stream_bio_method = { + BIO_TYPE_SOURCE_SINK, + "git_stream", + bio_write, + bio_read, + bio_puts, + bio_gets, + bio_ctrl, + bio_create, + bio_destroy +}; static int ssl_set_error(SSL *ssl, int error) { @@ -52,6 +132,7 @@ break; } giterr_set(GITERR_NET, "SSL error: received early EOF"); + return GIT_EEOF; break; case SSL_ERROR_SSL: e = ERR_get_error(); @@ -220,7 +301,8 @@ typedef struct { git_stream parent; - git_socket_stream *socket; + git_stream *io; + char *host; SSL *ssl; git_cert_x509 cert_info; } openssl_stream; @@ -230,20 +312,26 @@ int openssl_connect(git_stream *stream) { int ret; + BIO *bio; openssl_stream *st = (openssl_stream *) stream; - if ((ret = git_stream_connect((git_stream *)st->socket)) < 0) + if ((ret = git_stream_connect(st->io)) < 0) return ret; - if ((ret = SSL_set_fd(st->ssl, st->socket->s)) <= 0) { - openssl_close((git_stream *) st); - return ssl_set_error(st->ssl, ret); - } + bio = BIO_new(&git_stream_bio_method); + GITERR_CHECK_ALLOC(bio); + bio->ptr = st->io; + + SSL_set_bio(st->ssl, bio, bio); + /* specify the host in case SNI is needed */ +#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME + SSL_set_tlsext_host_name(st->ssl, st->host); +#endif if ((ret = SSL_connect(st->ssl)) <= 0) return ssl_set_error(st->ssl, ret); - return verify_server_cert(st->ssl, st->socket->host); + return verify_server_cert(st->ssl, st->host); } int openssl_certificate(git_cert **out, git_stream *stream) @@ -280,23 +368,25 @@ return 0; } +static int openssl_set_proxy(git_stream *stream, const char *proxy_url) +{ + openssl_stream *st = (openssl_stream *) stream; + + return git_stream_set_proxy(st->io, proxy_url); +} + ssize_t openssl_write(git_stream *stream, const char *data, size_t len, int flags) { openssl_stream *st = (openssl_stream *) stream; int ret; - size_t off = 0; GIT_UNUSED(flags); - while (off < len) { - ret = SSL_write(st->ssl, data + off, len - off); - if (ret <= 0 && ret != SSL_ERROR_WANT_WRITE) - return ssl_set_error(st->ssl, ret); - - off += ret; - } + if ((ret = SSL_write(st->ssl, data, len)) <= 0) { + return ssl_set_error(st->ssl, ret); + } - return off; + return ret; } ssize_t openssl_read(git_stream *stream, void *data, size_t len) @@ -304,14 +394,8 @@ openssl_stream *st = (openssl_stream *) stream; int ret; - do { - ret = SSL_read(st->ssl, data, len); - } while (SSL_get_error(st->ssl, ret) == SSL_ERROR_WANT_READ); - - if (ret < 0) { + if ((ret = SSL_read(st->ssl, data, len)) <= 0) ssl_set_error(st->ssl, ret); - return -1; - } return ret; } @@ -324,27 +408,35 @@ if ((ret = ssl_teardown(st->ssl)) < 0) return -1; - return git_stream_close((git_stream *)st->socket); + return git_stream_close(st->io); } void openssl_free(git_stream *stream) { openssl_stream *st = (openssl_stream *) stream; + git__free(st->host); git__free(st->cert_info.data); - git_stream_free((git_stream *) st->socket); + git_stream_free(st->io); git__free(st); } int git_openssl_stream_new(git_stream **out, const char *host, const char *port) { + int error; openssl_stream *st; st = git__calloc(1, sizeof(openssl_stream)); GITERR_CHECK_ALLOC(st); - if (git_socket_stream_new((git_stream **) &st->socket, host, port)) - return -1; +#ifdef GIT_CURL + error = git_curl_stream_new(&st->io, host, port); +#else + error = git_socket_stream_new(&st->io, host, port); +#endif + + if (error < 0) + return error; st->ssl = SSL_new(git__ssl_ctx); if (st->ssl == NULL) { @@ -352,10 +444,15 @@ return -1; } + st->host = git__strdup(host); + GITERR_CHECK_ALLOC(st->host); + st->parent.version = GIT_STREAM_VERSION; st->parent.encrypted = 1; + st->parent.proxy_support = git_stream_supports_proxy(st->io); st->parent.connect = openssl_connect; st->parent.certificate = openssl_certificate; + st->parent.set_proxy = openssl_set_proxy; st->parent.read = openssl_read; st->parent.write = openssl_write; st->parent.close = openssl_close; @@ -371,6 +468,10 @@ int git_openssl_stream_new(git_stream **out, const char *host, const char *port) { + GIT_UNUSED(out); + GIT_UNUSED(host); + GIT_UNUSED(port); + giterr_set(GITERR_SSL, "openssl is not supported in this version"); return -1; } diff -Nru libgit2-0.22.2/src/pack.c libgit2-0.23.1/src/pack.c --- libgit2-0.22.2/src/pack.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/pack.c 2015-08-03 18:07:35.000000000 +0000 @@ -16,6 +16,9 @@ #include +GIT__USE_OFFMAP +GIT__USE_OIDMAP + static int packfile_open(struct git_pack_file *p); static git_off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n); int packfile_unpack_compressed( @@ -316,9 +319,9 @@ static int pack_index_open(struct git_pack_file *p) { - char *idx_name; int error = 0; - size_t name_len, base_len; + size_t name_len; + git_buf idx_name = GIT_BUF_INIT; if (p->index_version > -1) return 0; @@ -326,22 +329,23 @@ name_len = strlen(p->pack_name); assert(name_len > strlen(".pack")); /* checked by git_pack_file alloc */ - if ((idx_name = git__malloc(name_len)) == NULL) + git_buf_grow(&idx_name, name_len); + git_buf_put(&idx_name, p->pack_name, name_len - strlen(".pack")); + git_buf_puts(&idx_name, ".idx"); + if (git_buf_oom(&idx_name)) { + giterr_set_oom(); return -1; - - base_len = name_len - strlen(".pack"); - memcpy(idx_name, p->pack_name, base_len); - memcpy(idx_name + base_len, ".idx", sizeof(".idx")); + } if ((error = git_mutex_lock(&p->lock)) < 0) { - git__free(idx_name); + git_buf_free(&idx_name); return error; } if (p->index_version == -1) - error = pack_index_check(idx_name, p); + error = pack_index_check(idx_name.ptr, p); - git__free(idx_name); + git_buf_free(&idx_name); git_mutex_unlock(&p->lock); @@ -631,7 +635,7 @@ struct pack_chain_elem *elem = NULL, *stack; git_pack_cache_entry *cached = NULL; struct pack_chain_elem small_stack[SMALL_STACK_SIZE]; - size_t stack_size = 0, elem_pos; + size_t stack_size = 0, elem_pos, alloclen; git_otype base_type; /* @@ -690,8 +694,11 @@ */ if (cached && stack_size == 1) { void *data = obj->data; - obj->data = git__malloc(obj->len + 1); + + GITERR_CHECK_ALLOC_ADD(&alloclen, obj->len, 1); + obj->data = git__malloc(alloclen); GITERR_CHECK_ALLOC(obj->data); + memcpy(obj->data, data, obj->len + 1); git_atomic_dec(&cached->refcount); goto cleanup; @@ -844,16 +851,18 @@ size_t size, git_otype type) { + size_t buf_size; int st; z_stream stream; unsigned char *buffer, *in; - buffer = git__calloc(1, size + 1); + GITERR_CHECK_ALLOC_ADD(&buf_size, size, 1); + buffer = git__calloc(1, buf_size); GITERR_CHECK_ALLOC(buffer); memset(&stream, 0, sizeof(stream)); stream.next_out = buffer; - stream.avail_out = (uInt)size + 1; + stream.avail_out = (uInt)buf_size; stream.zalloc = use_git_alloc; stream.zfree = use_git_free; @@ -951,8 +960,15 @@ if (k != kh_end(p->idx_cache)) { *curpos += 20; return ((struct git_pack_entry *)kh_value(p->idx_cache, k))->offset; + } else { + /* If we're building an index, don't try to find the pack + * entry; we just haven't seen it yet. We'll make + * progress again in the next loop. + */ + return GIT_PASSTHROUGH; } } + /* The base entry _must_ be in the same pack */ if (pack_entry_find_offset(&base_offset, &unused, p, (git_oid *)base_info, GIT_OID_HEXSZ) < 0) return packfile_error("base entry delta is not in the same pack"); @@ -1092,14 +1108,17 @@ { struct stat st; struct git_pack_file *p; - size_t path_len = path ? strlen(path) : 0; + size_t path_len = path ? strlen(path) : 0, alloc_len; *pack_out = NULL; if (path_len < strlen(".idx")) return git_odb__error_notfound("invalid packfile path", NULL); - p = git__calloc(1, sizeof(*p) + path_len + 2); + GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(*p), path_len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 2); + + p = git__calloc(1, alloc_len); GITERR_CHECK_ALLOC(p); memcpy(p->pack_name, path, path_len + 1); diff -Nru libgit2-0.22.2/src/pack.h libgit2-0.23.1/src/pack.h --- libgit2-0.22.2/src/pack.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/pack.h 2015-08-03 18:07:35.000000000 +0000 @@ -71,9 +71,7 @@ typedef git_array_t(struct pack_chain_elem) git_dependency_chain; #include "offmap.h" - -GIT__USE_OFFMAP; -GIT__USE_OIDMAP; +#include "oidmap.h" #define GIT_PACK_CACHE_MEMORY_LIMIT 16 * 1024 * 1024 #define GIT_PACK_CACHE_SIZE_LIMIT 1024 * 1024 /* don't bother caching anything over 1MB */ diff -Nru libgit2-0.22.2/src/pack-objects.c libgit2-0.23.1/src/pack-objects.c --- libgit2-0.22.2/src/pack-objects.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/pack-objects.c 2015-08-03 18:07:35.000000000 +0000 @@ -15,6 +15,8 @@ #include "thread-utils.h" #include "tree.h" #include "util.h" +#include "revwalk.h" +#include "commit_list.h" #include "git2/pack.h" #include "git2/commit.h" @@ -39,6 +41,8 @@ git_transfer_progress *stats; }; +GIT__USE_OIDMAP + #ifdef GIT_THREADS #define GIT_PACKBUILDER__MUTEX_OP(pb, mtx, op) do { \ @@ -124,10 +128,16 @@ GITERR_CHECK_ALLOC(pb); pb->object_ix = git_oidmap_alloc(); - if (!pb->object_ix) goto on_error; + pb->walk_objects = git_oidmap_alloc(); + if (!pb->walk_objects) + goto on_error; + + if (git_pool_init(&pb->object_pool, sizeof(git_walk_object), 0) < 0) + goto on_error; + pb->repo = repo; pb->nr_threads = 1; /* do not spawn any thread by default */ @@ -190,6 +200,7 @@ { git_pobject *po; khiter_t pos; + size_t newsize; int ret; assert(pb && oid); @@ -201,9 +212,18 @@ return 0; if (pb->nr_objects >= pb->nr_alloc) { - pb->nr_alloc = (pb->nr_alloc + 1024) * 3 / 2; - pb->object_list = git__realloc(pb->object_list, - pb->nr_alloc * sizeof(*po)); + GITERR_CHECK_ALLOC_ADD(&newsize, pb->nr_alloc, 1024); + GITERR_CHECK_ALLOC_MULTIPLY(&newsize, newsize, 3 / 2); + + if (!git__is_uint32(newsize)) { + giterr_set(GITERR_NOMEMORY, "Packfile too large to fit in memory."); + return -1; + } + + pb->nr_alloc = (uint32_t)newsize; + + pb->object_list = git__reallocarray(pb->object_list, + pb->nr_alloc, sizeof(*po)); GITERR_CHECK_ALLOC(pb->object_list); rehash(pb); } @@ -499,8 +519,10 @@ static git_pobject **compute_write_order(git_packbuilder *pb) { unsigned int i, wo_end, last_untagged; + git_pobject **wo; - git_pobject **wo = git__malloc(sizeof(*wo) * pb->nr_objects); + if ((wo = git__mallocarray(pb->nr_objects, sizeof(*wo))) == NULL) + return NULL; for (i = 0; i < pb->nr_objects; i++) { git_pobject *po = pb->object_list + i; @@ -770,10 +792,13 @@ *mem_usage += sz; } if (!src->data) { - if (git_odb_read(&obj, pb->odb, &src_object->id) < 0) + size_t obj_sz; + + if (git_odb_read(&obj, pb->odb, &src_object->id) < 0 || + !git__is_ulong(obj_sz = git_odb_object_size(obj))) return -1; - sz = (unsigned long)git_odb_object_size(obj); + sz = (unsigned long)obj_sz; src->data = git__malloc(sz); GITERR_CHECK_ALLOC(src->data); memcpy(src->data, git_odb_object_data(obj), sz); @@ -817,11 +842,14 @@ trg_object->delta_data = NULL; } if (delta_cacheable(pb, src_size, trg_size, delta_size)) { - pb->delta_cache_size += delta_size; + bool overflow = git__add_uint64_overflow( + &pb->delta_cache_size, pb->delta_cache_size, delta_size); + git_packbuilder__cache_unlock(pb); - trg_object->delta_data = git__realloc(delta_buf, delta_size); - GITERR_CHECK_ALLOC(trg_object->delta_data); + if (overflow || + !(trg_object->delta_data = git__realloc(delta_buf, delta_size))) + return -1; } else { /* create delta when writing the pack */ git_packbuilder__cache_unlock(pb); @@ -865,6 +893,29 @@ return freed_mem; } +static int report_delta_progress(git_packbuilder *pb, uint32_t count, bool force) +{ + int ret; + + if (pb->progress_cb) { + double current_time = git__timer(); + double elapsed = current_time - pb->last_progress_report_time; + + if (force || elapsed >= MIN_PROGRESS_UPDATE_INTERVAL) { + pb->last_progress_report_time = current_time; + + ret = pb->progress_cb( + GIT_PACKBUILDER_DELTAFICATION, + count, pb->nr_objects, pb->progress_cb_payload); + + if (ret) + return giterr_set_after_callback(ret); + } + } + + return 0; +} + static int find_deltas(git_packbuilder *pb, git_pobject **list, unsigned int *list_size, unsigned int window, int depth) @@ -890,6 +941,9 @@ break; } + pb->nr_deltified += 1; + report_delta_progress(pb, pb->nr_deltified, false); + po = *list++; (*list_size)--; git_packbuilder__progress_unlock(pb); @@ -1088,7 +1142,7 @@ return 0; } - p = git__malloc(pb->nr_threads * sizeof(*p)); + p = git__mallocarray(pb->nr_threads, sizeof(*p)); GITERR_CHECK_ALLOC(p); /* Partition the work among the threads */ @@ -1239,7 +1293,7 @@ if (pb->progress_cb) pb->progress_cb(GIT_PACKBUILDER_DELTAFICATION, 0, pb->nr_objects, pb->progress_cb_payload); - delta_list = git__malloc(pb->nr_objects * sizeof(*delta_list)); + delta_list = git__mallocarray(pb->nr_objects, sizeof(*delta_list)); GITERR_CHECK_ALLOC(delta_list); for (i = 0; i < pb->nr_objects; ++i) { @@ -1262,6 +1316,8 @@ } } + report_delta_progress(pb, pb->nr_objects, true); + pb->done = true; git__free(delta_list); return 0; @@ -1327,6 +1383,7 @@ return &pb->pack_oid; } + static int cb_tree_walk( const char *root, const git_tree_entry *entry, void *payload) { @@ -1375,6 +1432,42 @@ return error; } +int git_packbuilder_insert_recur(git_packbuilder *pb, const git_oid *id, const char *name) +{ + git_object *obj; + int error; + + assert(pb && id); + + if ((error = git_object_lookup(&obj, pb->repo, id, GIT_OBJ_ANY)) < 0) + return error; + + switch (git_object_type(obj)) { + case GIT_OBJ_BLOB: + error = git_packbuilder_insert(pb, id, name); + break; + case GIT_OBJ_TREE: + error = git_packbuilder_insert_tree(pb, id); + break; + case GIT_OBJ_COMMIT: + error = git_packbuilder_insert_commit(pb, id); + break; + case GIT_OBJ_TAG: + if ((error = git_packbuilder_insert(pb, id, name)) < 0) + goto cleanup; + error = git_packbuilder_insert_recur(pb, git_tag_target_id((git_tag *) obj), NULL); + break; + + default: + giterr_set(GITERR_INVALID, "unknown object type"); + error = -1; + } + +cleanup: + git_object_free(obj); + return error; +} + uint32_t git_packbuilder_object_count(git_packbuilder *pb) { return pb->nr_objects; @@ -1385,6 +1478,235 @@ return pb->nr_written; } +int lookup_walk_object(git_walk_object **out, git_packbuilder *pb, const git_oid *id) +{ + git_walk_object *obj; + + obj = git_pool_mallocz(&pb->object_pool, 1); + if (!obj) { + giterr_set_oom(); + return -1; + } + + git_oid_cpy(&obj->id, id); + + *out = obj; + return 0; +} + +static int retrieve_object(git_walk_object **out, git_packbuilder *pb, const git_oid *id) +{ + int error; + khiter_t pos; + git_walk_object *obj; + + pos = git_oidmap_lookup_index(pb->walk_objects, id); + if (git_oidmap_valid_index(pb->walk_objects, pos)) { + obj = git_oidmap_value_at(pb->walk_objects, pos); + } else { + if ((error = lookup_walk_object(&obj, pb, id)) < 0) + return error; + + git_oidmap_insert(pb->walk_objects, &obj->id, obj, error); + } + + *out = obj; + return 0; +} + +static int mark_blob_uninteresting(git_packbuilder *pb, const git_oid *id) +{ + int error; + git_walk_object *obj; + + if ((error = retrieve_object(&obj, pb, id)) < 0) + return error; + + obj->uninteresting = 1; + + return 0; +} + +static int mark_tree_uninteresting(git_packbuilder *pb, const git_oid *id) +{ + git_walk_object *obj; + git_tree *tree; + int error; + size_t i; + + if ((error = retrieve_object(&obj, pb, id)) < 0) + return error; + + if (obj->uninteresting) + return 0; + + obj->uninteresting = 1; + + if ((error = git_tree_lookup(&tree, pb->repo, id)) < 0) + return error; + + for (i = 0; i < git_tree_entrycount(tree); i++) { + const git_tree_entry *entry = git_tree_entry_byindex(tree, i); + const git_oid *entry_id = git_tree_entry_id(entry); + switch (git_tree_entry_type(entry)) { + case GIT_OBJ_TREE: + if ((error = mark_tree_uninteresting(pb, entry_id)) < 0) + goto cleanup; + break; + case GIT_OBJ_BLOB: + if ((error = mark_blob_uninteresting(pb, entry_id)) < 0) + goto cleanup; + break; + default: + /* it's a submodule or something unknown, we don't want it */ + ; + } + } + +cleanup: + git_tree_free(tree); + return error; +} + +/* + * Mark the edges of the graph uninteresting. Since we start from a + * git_revwalk, the commits are already uninteresting, but we need to + * mark the trees and blobs. + */ +static int mark_edges_uninteresting(git_packbuilder *pb, git_commit_list *commits) +{ + int error; + git_commit_list *list; + git_commit *commit; + + for (list = commits; list; list = list->next) { + if (!list->item->uninteresting) + continue; + + if ((error = git_commit_lookup(&commit, pb->repo, &list->item->oid)) < 0) + return error; + + error = mark_tree_uninteresting(pb, git_commit_tree_id(commit)); + git_commit_free(commit); + + if (error < 0) + return error; + } + + return 0; +} + +int insert_tree(git_packbuilder *pb, git_tree *tree) +{ + size_t i; + int error; + git_tree *subtree; + git_walk_object *obj; + const char *name; + + if ((error = retrieve_object(&obj, pb, git_tree_id(tree))) < 0) + return error; + + if (obj->seen) + return 0; + + obj->seen = 1; + + if ((error = git_packbuilder_insert(pb, &obj->id, NULL))) + return error; + + for (i = 0; i < git_tree_entrycount(tree); i++) { + const git_tree_entry *entry = git_tree_entry_byindex(tree, i); + const git_oid *entry_id = git_tree_entry_id(entry); + switch (git_tree_entry_type(entry)) { + case GIT_OBJ_TREE: + if ((error = git_tree_lookup(&subtree, pb->repo, entry_id)) < 0) + return error; + + error = insert_tree(pb, subtree); + git_tree_free(subtree); + + if (error < 0) + return error; + + break; + case GIT_OBJ_BLOB: + name = git_tree_entry_name(entry); + if ((error = git_packbuilder_insert(pb, entry_id, name)) < 0) + return error; + break; + default: + /* it's a submodule or something unknown, we don't want it */ + ; + } + } + + + return error; +} + +int insert_commit(git_packbuilder *pb, git_walk_object *obj) +{ + int error; + git_commit *commit = NULL; + git_tree *tree = NULL; + + obj->seen = 1; + + if ((error = git_packbuilder_insert(pb, &obj->id, NULL)) < 0) + return error; + + if ((error = git_commit_lookup(&commit, pb->repo, &obj->id)) < 0) + return error; + + if ((error = git_tree_lookup(&tree, pb->repo, git_commit_tree_id(commit))) < 0) + goto cleanup; + + if ((error = insert_tree(pb, tree)) < 0) + goto cleanup; + +cleanup: + git_commit_free(commit); + git_tree_free(tree); + return error; +} + +int git_packbuilder_insert_walk(git_packbuilder *pb, git_revwalk *walk) +{ + int error; + git_oid id; + git_walk_object *obj; + + assert(pb && walk); + + if ((error = mark_edges_uninteresting(pb, walk->user_input)) < 0) + return error; + + /* + * TODO: git marks the parents of the edges + * uninteresting. This may provide a speed advantage, but does + * seem to assume the remote does not have a single-commit + * history on the other end. + */ + + /* walk down each tree up to the blobs and insert them, stopping when uninteresting */ + while ((error = git_revwalk_next(&id, walk)) == 0) { + if ((error = retrieve_object(&obj, pb, &id)) < 0) + return error; + + if (obj->seen || obj->uninteresting) + continue; + + if ((error = insert_commit(pb, obj)) < 0) + return error; + } + + if (error == GIT_ITEROVER) + error = 0; + + return 0; +} + int git_packbuilder_set_callbacks(git_packbuilder *pb, git_packbuilder_progress progress_cb, void *progress_cb_payload) { if (!pb) @@ -1418,6 +1740,9 @@ if (pb->object_list) git__free(pb->object_list); + git_oidmap_free(pb->walk_objects); + git_pool_clear(&pb->object_pool); + git_hash_ctx_cleanup(&pb->ctx); git_zstream_free(&pb->zstream); diff -Nru libgit2-0.22.2/src/pack-objects.h libgit2-0.23.1/src/pack-objects.h --- libgit2-0.22.2/src/pack-objects.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/pack-objects.h 2015-08-03 18:07:35.000000000 +0000 @@ -15,6 +15,7 @@ #include "oidmap.h" #include "netops.h" #include "zstream.h" +#include "pool.h" #include "git2/oid.h" #include "git2/pack.h" @@ -50,6 +51,12 @@ filled:1; } git_pobject; +typedef struct { + git_oid id; + unsigned int uninteresting:1, + seen:1; +} git_walk_object; + struct git_packbuilder { git_repository *repo; /* associated repository */ git_odb *odb; /* associated object database */ @@ -58,6 +65,7 @@ git_zstream zstream; uint32_t nr_objects, + nr_deltified, nr_alloc, nr_written, nr_remaining; @@ -66,6 +74,9 @@ git_oidmap *object_ix; + git_oidmap *walk_objects; + git_pool object_pool; + git_oid pack_oid; /* hash of written pack */ /* synchronization objects */ diff -Nru libgit2-0.22.2/src/path.c libgit2-0.23.1/src/path.c --- libgit2-0.22.2/src/path.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/path.c 2015-08-03 18:07:35.000000000 +0000 @@ -10,7 +10,9 @@ #include "repository.h" #ifdef GIT_WIN32 #include "win32/posix.h" +#include "win32/buffer.h" #include "win32/w32_util.h" +#include "win32/version.h" #else #include #endif @@ -260,6 +262,20 @@ return -1; /* Not a real error - signals that path is not rooted */ } +void git_path_trim_slashes(git_buf *path) +{ + int ceiling = git_path_root(path->ptr) + 1; + assert(ceiling >= 0); + + while (path->size > (size_t)ceiling) { + if (path->ptr[path->size-1] != '/') + break; + + path->ptr[path->size-1] = '\0'; + path->size--; + } +} + int git_path_join_unrooted( git_buf *path_out, const char *path, const char *base, ssize_t *root_at) { @@ -620,9 +636,12 @@ bool result; size_t dir_size = git_buf_len(dir); size_t sub_size = strlen(sub); + size_t alloc_size; /* leave base valid even if we could not make space for subdir */ - if (git_buf_try_grow(dir, dir_size + sub_size + 2, false, false) < 0) + if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, dir_size, sub_size) || + GIT_ADD_SIZET_OVERFLOW(&alloc_size, alloc_size, 2) || + git_buf_try_grow(dir, alloc_size, false) < 0) return false; /* save excursion */ @@ -784,7 +803,7 @@ int git_path_make_relative(git_buf *path, const char *parent) { const char *p, *q, *p_dirsep, *q_dirsep; - size_t plen = path->size, newlen, depth = 1, i, offset; + size_t plen = path->size, newlen, alloclen, depth = 1, i, offset; for (p_dirsep = p = path->ptr, q_dirsep = q = parent; *p && *q; p++, q++) { if (*p == '/' && *q == '/') { @@ -822,11 +841,14 @@ for (; (q = strchr(q, '/')) && *(q + 1); q++) depth++; - newlen = (depth * 3) + plen; + GITERR_CHECK_ALLOC_MULTIPLY(&newlen, depth, 3); + GITERR_CHECK_ALLOC_ADD(&newlen, newlen, plen); + + GITERR_CHECK_ALLOC_ADD(&alloclen, newlen, 1); /* save the offset as we might realllocate the pointer */ offset = p - path->ptr; - if (git_buf_try_grow(path, newlen + 1, 1, 0) < 0) + if (git_buf_try_grow(path, alloclen, 1) < 0) return -1; p = path->ptr + offset; @@ -868,10 +890,10 @@ } } -int git_path_iconv(git_path_iconv_t *ic, char **in, size_t *inlen) +int git_path_iconv(git_path_iconv_t *ic, const char **in, size_t *inlen) { - char *nfd = *in, *nfc; - size_t nfdlen = *inlen, nfclen, wantlen = nfdlen, rv; + char *nfd = (char*)*in, *nfc; + size_t nfdlen = *inlen, nfclen, wantlen = nfdlen, alloclen, rv; int retry = 1; if (!ic || ic->map == (iconv_t)-1 || @@ -881,7 +903,8 @@ git_buf_clear(&ic->buf); while (1) { - if (git_buf_grow(&ic->buf, wantlen + 1) < 0) + GITERR_CHECK_ALLOC_ADD(&alloclen, wantlen, 1); + if (git_buf_grow(&ic->buf, alloclen) < 0) return -1; nfc = ic->buf.ptr + ic->buf.size; @@ -996,15 +1019,14 @@ int error = 0; ssize_t wd_len; DIR *dir; - path_dirent_data de_data; - struct dirent *de, *de_buf = (struct dirent *)&de_data; - - GIT_UNUSED(flags); + struct dirent *de; #ifdef GIT_USE_ICONV git_path_iconv_t ic = GIT_PATH_ICONV_INIT; #endif + GIT_UNUSED(flags); + if (git_path_to_dir(path) < 0) return -1; @@ -1023,8 +1045,8 @@ (void)git_path_iconv_init_precompose(&ic); #endif - while (p_readdir_r(dir, de_buf, &de) == 0 && de != NULL) { - char *de_path = de->d_name; + while ((de = readdir(dir)) != NULL) { + const char *de_path = de->d_name; size_t de_len = strlen(de_path); if (git_path_is_dot_or_dotdot(de_path)) @@ -1038,12 +1060,16 @@ if ((error = git_buf_put(path, de_path, de_len)) < 0) break; + giterr_clear(); error = fn(arg, path); git_buf_truncate(path, wd_len); /* restore path */ + /* Only set our own error if the callback did not set one already */ if (error != 0) { - giterr_set_after_callback(error); + if (!giterr_last()) + giterr_set_after_callback(error); + break; } } @@ -1057,183 +1083,333 @@ return error; } -int git_path_dirload( +#if defined(GIT_WIN32) && !defined(__MINGW32__) + +/* Using _FIND_FIRST_EX_LARGE_FETCH may increase performance in Windows 7 + * and better. + */ +#ifndef FIND_FIRST_EX_LARGE_FETCH +# define FIND_FIRST_EX_LARGE_FETCH 2 +#endif + +int git_path_diriter_init( + git_path_diriter *diriter, const char *path, - size_t prefix_len, - size_t alloc_extra, - unsigned int flags, - git_vector *contents) + unsigned int flags) { - int error, need_slash; - DIR *dir; - size_t path_len; - path_dirent_data de_data; - struct dirent *de, *de_buf = (struct dirent *)&de_data; + git_win32_path path_filter; + git_buf hack = {0}; - GIT_UNUSED(flags); + static int is_win7_or_later = -1; + if (is_win7_or_later < 0) + is_win7_or_later = git_has_win32_version(6, 1, 0); -#ifdef GIT_USE_ICONV - git_path_iconv_t ic = GIT_PATH_ICONV_INIT; -#endif + assert(diriter && path); + + memset(diriter, 0, sizeof(git_path_diriter)); + diriter->handle = INVALID_HANDLE_VALUE; + + if (git_buf_puts(&diriter->path_utf8, path) < 0) + return -1; + + git_path_trim_slashes(&diriter->path_utf8); + + if (diriter->path_utf8.size == 0) { + giterr_set(GITERR_FILESYSTEM, "Could not open directory '%s'", path); + return -1; + } - assert(path && contents); + if ((diriter->parent_len = git_win32_path_from_utf8(diriter->path, diriter->path_utf8.ptr)) < 0 || + !git_win32__findfirstfile_filter(path_filter, diriter->path_utf8.ptr)) { + giterr_set(GITERR_OS, "Could not parse the directory path '%s'", path); + return -1; + } - path_len = strlen(path); + diriter->handle = FindFirstFileExW( + path_filter, + is_win7_or_later ? FindExInfoBasic : FindExInfoStandard, + &diriter->current, + FindExSearchNameMatch, + NULL, + is_win7_or_later ? FIND_FIRST_EX_LARGE_FETCH : 0); - if (!path_len || path_len < prefix_len) { - giterr_set(GITERR_INVALID, "Invalid directory path '%s'", path); + if (diriter->handle == INVALID_HANDLE_VALUE) { + giterr_set(GITERR_OS, "Could not open directory '%s'", path); return -1; } - if ((dir = opendir(path)) == NULL) { + + diriter->parent_utf8_len = diriter->path_utf8.size; + diriter->flags = flags; + return 0; +} + +static int diriter_update_paths(git_path_diriter *diriter) +{ + size_t filename_len, path_len; + + filename_len = wcslen(diriter->current.cFileName); + + if (GIT_ADD_SIZET_OVERFLOW(&path_len, diriter->parent_len, filename_len) || + GIT_ADD_SIZET_OVERFLOW(&path_len, path_len, 2)) + return -1; + + if (path_len > GIT_WIN_PATH_UTF16) { + giterr_set(GITERR_FILESYSTEM, + "invalid path '%.*ls\\%ls' (path too long)", + diriter->parent_len, diriter->path, diriter->current.cFileName); + return -1; + } + + diriter->path[diriter->parent_len] = L'\\'; + memcpy(&diriter->path[diriter->parent_len+1], + diriter->current.cFileName, filename_len * sizeof(wchar_t)); + diriter->path[path_len-1] = L'\0'; + + git_buf_truncate(&diriter->path_utf8, diriter->parent_utf8_len); + git_buf_putc(&diriter->path_utf8, '/'); + git_buf_put_w(&diriter->path_utf8, diriter->current.cFileName, filename_len); + + if (git_buf_oom(&diriter->path_utf8)) + return -1; + + return 0; +} + +int git_path_diriter_next(git_path_diriter *diriter) +{ + bool skip_dot = !(diriter->flags & GIT_PATH_DIR_INCLUDE_DOT_AND_DOTDOT); + + do { + /* Our first time through, we already have the data from + * FindFirstFileW. Use it, otherwise get the next file. + */ + if (!diriter->needs_next) + diriter->needs_next = 1; + else if (!FindNextFileW(diriter->handle, &diriter->current)) + return GIT_ITEROVER; + } while (skip_dot && git_path_is_dot_or_dotdotW(diriter->current.cFileName)); + + if (diriter_update_paths(diriter) < 0) + return -1; + + return 0; +} + +int git_path_diriter_filename( + const char **out, + size_t *out_len, + git_path_diriter *diriter) +{ + assert(out && out_len && diriter); + + assert(diriter->path_utf8.size > diriter->parent_utf8_len); + + *out = &diriter->path_utf8.ptr[diriter->parent_utf8_len+1]; + *out_len = diriter->path_utf8.size - diriter->parent_utf8_len - 1; + return 0; +} + +int git_path_diriter_fullpath( + const char **out, + size_t *out_len, + git_path_diriter *diriter) +{ + assert(out && out_len && diriter); + + *out = diriter->path_utf8.ptr; + *out_len = diriter->path_utf8.size; + return 0; +} + +int git_path_diriter_stat(struct stat *out, git_path_diriter *diriter) +{ + assert(out && diriter); + + return git_win32__file_attribute_to_stat(out, + (WIN32_FILE_ATTRIBUTE_DATA *)&diriter->current, + diriter->path); +} + +void git_path_diriter_free(git_path_diriter *diriter) +{ + if (diriter == NULL) + return; + + git_buf_free(&diriter->path_utf8); + + if (diriter->handle != INVALID_HANDLE_VALUE) { + FindClose(diriter->handle); + diriter->handle = INVALID_HANDLE_VALUE; + } +} + +#else + +int git_path_diriter_init( + git_path_diriter *diriter, + const char *path, + unsigned int flags) +{ + assert(diriter && path); + + memset(diriter, 0, sizeof(git_path_diriter)); + + if (git_buf_puts(&diriter->path, path) < 0) + return -1; + + git_path_trim_slashes(&diriter->path); + + if (diriter->path.size == 0) { + giterr_set(GITERR_FILESYSTEM, "Could not open directory '%s'", path); + return -1; + } + + if ((diriter->dir = opendir(diriter->path.ptr)) == NULL) { + git_buf_free(&diriter->path); + giterr_set(GITERR_OS, "Failed to open directory '%s'", path); return -1; } #ifdef GIT_USE_ICONV if ((flags & GIT_PATH_DIR_PRECOMPOSE_UNICODE) != 0) - (void)git_path_iconv_init_precompose(&ic); + (void)git_path_iconv_init_precompose(&diriter->ic); #endif - path += prefix_len; - path_len -= prefix_len; - need_slash = (path_len > 0 && path[path_len-1] != '/') ? 1 : 0; - - while ((error = p_readdir_r(dir, de_buf, &de)) == 0 && de != NULL) { - char *entry_path, *de_path = de->d_name; - size_t alloc_size, de_len = strlen(de_path); + diriter->parent_len = diriter->path.size; + diriter->flags = flags; - if (git_path_is_dot_or_dotdot(de_path)) - continue; + return 0; +} -#ifdef GIT_USE_ICONV - if ((error = git_path_iconv(&ic, &de_path, &de_len)) < 0) - break; -#endif +int git_path_diriter_next(git_path_diriter *diriter) +{ + struct dirent *de; + const char *filename; + size_t filename_len; + bool skip_dot = !(diriter->flags & GIT_PATH_DIR_INCLUDE_DOT_AND_DOTDOT); + int error = 0; - alloc_size = path_len + need_slash + de_len + 1 + alloc_extra; - if ((entry_path = git__calloc(alloc_size, 1)) == NULL) { - error = -1; - break; - } + assert(diriter); - if (path_len) - memcpy(entry_path, path, path_len); - if (need_slash) - entry_path[path_len] = '/'; - memcpy(&entry_path[path_len + need_slash], de_path, de_len); + errno = 0; - if ((error = git_vector_insert(contents, entry_path)) < 0) { - git__free(entry_path); - break; + do { + if ((de = readdir(diriter->dir)) == NULL) { + if (!errno) + return GIT_ITEROVER; + + giterr_set(GITERR_OS, + "Could not read directory '%s'", diriter->path); + return -1; } - } + } while (skip_dot && git_path_is_dot_or_dotdot(de->d_name)); - closedir(dir); + filename = de->d_name; + filename_len = strlen(filename); #ifdef GIT_USE_ICONV - git_path_iconv_clear(&ic); + if ((diriter->flags & GIT_PATH_DIR_PRECOMPOSE_UNICODE) != 0 && + (error = git_path_iconv(&diriter->ic, &filename, &filename_len)) < 0) + return error; #endif - if (error != 0) - giterr_set(GITERR_OS, "Failed to process directory entry in '%s'", path); + git_buf_truncate(&diriter->path, diriter->parent_len); + git_buf_putc(&diriter->path, '/'); + git_buf_put(&diriter->path, filename, filename_len); + + if (git_buf_oom(&diriter->path)) + return -1; return error; } -int git_path_with_stat_cmp(const void *a, const void *b) +int git_path_diriter_filename( + const char **out, + size_t *out_len, + git_path_diriter *diriter) { - const git_path_with_stat *psa = a, *psb = b; - return strcmp(psa->path, psb->path); + assert(out && out_len && diriter); + + assert(diriter->path.size > diriter->parent_len); + + *out = &diriter->path.ptr[diriter->parent_len+1]; + *out_len = diriter->path.size - diriter->parent_len - 1; + return 0; } -int git_path_with_stat_cmp_icase(const void *a, const void *b) +int git_path_diriter_fullpath( + const char **out, + size_t *out_len, + git_path_diriter *diriter) { - const git_path_with_stat *psa = a, *psb = b; - return strcasecmp(psa->path, psb->path); + assert(out && out_len && diriter); + + *out = diriter->path.ptr; + *out_len = diriter->path.size; + return 0; } -int git_path_dirload_with_stat( - const char *path, - size_t prefix_len, - unsigned int flags, - const char *start_stat, - const char *end_stat, - git_vector *contents) +int git_path_diriter_stat(struct stat *out, git_path_diriter *diriter) { - int error; - unsigned int i; - git_path_with_stat *ps; - git_buf full = GIT_BUF_INIT; - int (*strncomp)(const char *a, const char *b, size_t sz); - size_t start_len = start_stat ? strlen(start_stat) : 0; - size_t end_len = end_stat ? strlen(end_stat) : 0, cmp_len; + assert(out && diriter); - if (git_buf_set(&full, path, prefix_len) < 0) - return -1; + return git_path_lstat(diriter->path.ptr, out); +} - error = git_path_dirload( - path, prefix_len, sizeof(git_path_with_stat) + 1, flags, contents); - if (error < 0) { - git_buf_free(&full); - return error; +void git_path_diriter_free(git_path_diriter *diriter) +{ + if (diriter == NULL) + return; + + if (diriter->dir) { + closedir(diriter->dir); + diriter->dir = NULL; } - strncomp = (flags & GIT_PATH_DIR_IGNORE_CASE) != 0 ? - git__strncasecmp : git__strncmp; +#ifdef GIT_USE_ICONV + git_path_iconv_clear(&diriter->ic); +#endif - /* stat struct at start of git_path_with_stat, so shift path text */ - git_vector_foreach(contents, i, ps) { - size_t path_len = strlen((char *)ps); - memmove(ps->path, ps, path_len + 1); - ps->path_len = path_len; - } + git_buf_free(&diriter->path); +} - git_vector_foreach(contents, i, ps) { - /* skip if before start_stat or after end_stat */ - cmp_len = min(start_len, ps->path_len); - if (cmp_len && strncomp(ps->path, start_stat, cmp_len) < 0) - continue; - cmp_len = min(end_len, ps->path_len); - if (cmp_len && strncomp(ps->path, end_stat, cmp_len) > 0) - continue; +#endif + +int git_path_dirload( + git_vector *contents, + const char *path, + size_t prefix_len, + unsigned int flags) +{ + git_path_diriter iter = GIT_PATH_DIRITER_INIT; + const char *name; + size_t name_len; + char *dup; + int error; - git_buf_truncate(&full, prefix_len); + assert(contents && path); - if ((error = git_buf_joinpath(&full, full.ptr, ps->path)) < 0 || - (error = git_path_lstat(full.ptr, &ps->st)) < 0) { + if ((error = git_path_diriter_init(&iter, path, flags)) < 0) + return error; - if (error == GIT_ENOTFOUND) { - /* file was removed between readdir and lstat */ - char *entry_path = git_vector_get(contents, i); - git_vector_remove(contents, i--); - git__free(entry_path); - } else { - /* Treat the file as unreadable if we get any other error */ - memset(&ps->st, 0, sizeof(ps->st)); - ps->st.st_mode = GIT_FILEMODE_UNREADABLE; - } + while ((error = git_path_diriter_next(&iter)) == 0) { + if ((error = git_path_diriter_fullpath(&name, &name_len, &iter)) < 0) + break; - giterr_clear(); - error = 0; - continue; - } + assert(name_len > prefix_len); - if (S_ISDIR(ps->st.st_mode)) { - ps->path[ps->path_len++] = '/'; - ps->path[ps->path_len] = '\0'; - } - else if (!S_ISREG(ps->st.st_mode) && !S_ISLNK(ps->st.st_mode)) { - char *entry_path = git_vector_get(contents, i); - git_vector_remove(contents, i--); - git__free(entry_path); - } - } + dup = git__strndup(name + prefix_len, name_len - prefix_len); + GITERR_CHECK_ALLOC(dup); - /* sort now that directory suffix is added */ - git_vector_sort(contents); + if ((error = git_vector_insert(contents, dup)) < 0) + break; + } - git_buf_free(&full); + if (error == GIT_ITEROVER) + error = 0; + git_path_diriter_free(&iter); return error; } @@ -1303,7 +1479,7 @@ * the ASCII range, which is perfectly fine, because the * git folder name can only be composed of ascii characters */ - return tolower(codepoint); + return git__tolower(codepoint); } return 0; /* NULL byte -- end of string */ } @@ -1322,30 +1498,31 @@ GIT_INLINE(bool) verify_dotgit_ntfs(git_repository *repo, const char *path, size_t len) { - const char *shortname = NULL; - size_t i, start, shortname_len = 0; + git_buf *reserved = git_repository__reserved_names_win32; + size_t reserved_len = git_repository__reserved_names_win32_len; + size_t start = 0, i; + + if (repo) + git_repository__reserved_names(&reserved, &reserved_len, repo, true); + + for (i = 0; i < reserved_len; i++) { + git_buf *r = &reserved[i]; + + if (len >= r->size && + strncasecmp(path, r->ptr, r->size) == 0) { + start = r->size; + break; + } + } - /* See if the repo has a custom shortname (not "GIT~1") */ - if (repo && - (shortname = git_repository__8dot3_name(repo)) && - shortname != git_repository__8dot3_default) - shortname_len = strlen(shortname); - - if (len >= 4 && strncasecmp(path, ".git", 4) == 0) - start = 4; - else if (len >= git_repository__8dot3_default_len && - strncasecmp(path, git_repository__8dot3_default, git_repository__8dot3_default_len) == 0) - start = git_repository__8dot3_default_len; - else if (shortname_len && len >= shortname_len && - strncasecmp(path, shortname, shortname_len) == 0) - start = shortname_len; - else + if (!start) return true; - /* Reject paths beginning with ".git\" */ + /* Reject paths like ".git\" */ if (path[start] == '\\') return false; + /* Reject paths like '.git ' or '.git.' */ for (i = start; i < len; i++) { if (path[i] != ' ' && path[i] != '.') return true; diff -Nru libgit2-0.22.2/src/path.h libgit2-0.23.1/src/path.h --- libgit2-0.22.2/src/path.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/path.h 2015-08-03 18:07:35.000000000 +0000 @@ -273,6 +273,7 @@ enum { GIT_PATH_DIR_IGNORE_CASE = (1u << 0), GIT_PATH_DIR_PRECOMPOSE_UNICODE = (1u << 1), + GIT_PATH_DIR_INCLUDE_DOT_AND_DOTDOT = (1u << 2), }; /** @@ -318,7 +319,7 @@ * @param callback Function to invoke on each path. Passed the `payload` * and the buffer containing the current path. The path should not * be modified in any way. Return non-zero to stop iteration. - * @param state Passed to fn as the first ath. + * @param payload Passed to fn as the first ath. */ extern int git_path_walk_up( git_buf *pathbuf, @@ -326,66 +327,6 @@ int (*callback)(void *payload, const char *path), void *payload); -/** - * Load all directory entries (except '.' and '..') into a vector. - * - * For cases where `git_path_direach()` is not appropriate, this - * allows you to load the filenames in a directory into a vector - * of strings. That vector can then be sorted, iterated, or whatever. - * Remember to free alloc of the allocated strings when you are done. - * - * @param path The directory to read from. - * @param prefix_len When inserting entries, the trailing part of path - * will be prefixed after this length. I.e. given path "/a/b" and - * prefix_len 3, the entries will look like "b/e1", "b/e2", etc. - * @param alloc_extra Extra bytes to add to each string allocation in - * case you want to append anything funny. - * @param flags Combination of GIT_PATH_DIR flags. - * @param contents Vector to fill with directory entry names. - */ -extern int git_path_dirload( - const char *path, - size_t prefix_len, - size_t alloc_extra, - uint32_t flags, - git_vector *contents); - - -typedef struct { - struct stat st; - size_t path_len; - char path[GIT_FLEX_ARRAY]; -} git_path_with_stat; - -extern int git_path_with_stat_cmp(const void *a, const void *b); -extern int git_path_with_stat_cmp_icase(const void *a, const void *b); - -/** - * Load all directory entries along with stat info into a vector. - * - * This adds four things on top of plain `git_path_dirload`: - * - * 1. Each entry in the vector is a `git_path_with_stat` struct that - * contains both the path and the stat info - * 2. The entries will be sorted alphabetically - * 3. Entries that are directories will be suffixed with a '/' - * 4. Optionally, you can be a start and end prefix and only elements - * after the start and before the end (inclusively) will be stat'ed. - * - * @param path The directory to read from - * @param prefix_len The trailing part of path to prefix to entry paths - * @param flags GIT_PATH_DIR flags from above - * @param start_stat As optimization, only stat values after this prefix - * @param end_stat As optimization, only stat values before this prefix - * @param contents Vector to fill with git_path_with_stat structures - */ -extern int git_path_dirload_with_stat( - const char *path, - size_t prefix_len, - uint32_t flags, - const char *start_stat, - const char *end_stat, - git_vector *contents); enum { GIT_PATH_NOTEQUAL = 0, GIT_PATH_EQUAL = 1, GIT_PATH_PREFIX = 2 }; @@ -466,12 +407,143 @@ * pointer internal iconv buffer if rewrite happened. The `in` pointer * will be left unchanged if no rewrite was needed. */ -extern int git_path_iconv(git_path_iconv_t *ic, char **in, size_t *inlen); +extern int git_path_iconv(git_path_iconv_t *ic, const char **in, size_t *inlen); #endif /* GIT_USE_ICONV */ extern bool git_path_does_fs_decompose_unicode(const char *root); + +typedef struct git_path_diriter git_path_diriter; + +#if defined(GIT_WIN32) && !defined(__MINGW32__) + +struct git_path_diriter +{ + git_win32_path path; + size_t parent_len; + + git_buf path_utf8; + size_t parent_utf8_len; + + HANDLE handle; + + unsigned int flags; + + WIN32_FIND_DATAW current; + unsigned int needs_next; +}; + +#define GIT_PATH_DIRITER_INIT { {0}, 0, GIT_BUF_INIT, 0, INVALID_HANDLE_VALUE } + +#else + +struct git_path_diriter +{ + git_buf path; + size_t parent_len; + + unsigned int flags; + + DIR *dir; + +#ifdef GIT_USE_ICONV + git_path_iconv_t ic; +#endif +}; + +#define GIT_PATH_DIRITER_INIT { GIT_BUF_INIT } + +#endif + +/** + * Initialize a directory iterator. + * + * @param diriter Pointer to a diriter structure that will be setup. + * @param path The path that will be iterated over + * @param flags Directory reader flags + * @return 0 or an error code + */ +extern int git_path_diriter_init( + git_path_diriter *diriter, + const char *path, + unsigned int flags); + +/** + * Advance the directory iterator. Will return GIT_ITEROVER when + * the iteration has completed successfully. + * + * @param diriter The directory iterator + * @return 0, GIT_ITEROVER, or an error code + */ +extern int git_path_diriter_next(git_path_diriter *diriter); + +/** + * Returns the file name of the current item in the iterator. + * + * @param out Pointer to store the path in + * @param out_len Pointer to store the length of the path in + * @param diriter The directory iterator + * @return 0 or an error code + */ +extern int git_path_diriter_filename( + const char **out, + size_t *out_len, + git_path_diriter *diriter); + +/** + * Returns the full path of the current item in the iterator; that + * is the current filename plus the path of the directory that the + * iterator was constructed with. + * + * @param out Pointer to store the path in + * @param out_len Pointer to store the length of the path in + * @param diriter The directory iterator + * @return 0 or an error code + */ +extern int git_path_diriter_fullpath( + const char **out, + size_t *out_len, + git_path_diriter *diriter); + +/** + * Performs an `lstat` on the current item in the iterator. + * + * @param out Pointer to store the stat data in + * @param diriter The directory iterator + * @return 0 or an error code + */ +extern int git_path_diriter_stat(struct stat *out, git_path_diriter *diriter); + +/** + * Closes the directory iterator. + * + * @param diriter The directory iterator + */ +extern void git_path_diriter_free(git_path_diriter *diriter); + +/** + * Load all directory entries (except '.' and '..') into a vector. + * + * For cases where `git_path_direach()` is not appropriate, this + * allows you to load the filenames in a directory into a vector + * of strings. That vector can then be sorted, iterated, or whatever. + * Remember to free alloc of the allocated strings when you are done. + * + * @param contents Vector to fill with directory entry names. + * @param path The directory to read from. + * @param prefix_len When inserting entries, the trailing part of path + * will be prefixed after this length. I.e. given path "/a/b" and + * prefix_len 3, the entries will look like "b/e1", "b/e2", etc. + * @param flags Combination of GIT_PATH_DIR flags. + */ +extern int git_path_dirload( + git_vector *contents, + const char *path, + size_t prefix_len, + uint32_t flags); + + /* Used for paths to repositories on the filesystem */ extern bool git_path_is_local_file_url(const char *file_url); extern int git_path_from_url_or_path(git_buf *local_path_out, const char *url_or_path); diff -Nru libgit2-0.22.2/src/pathspec.c libgit2-0.23.1/src/pathspec.c --- libgit2-0.22.2/src/pathspec.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/pathspec.c 2015-08-03 18:07:35.000000000 +0000 @@ -318,6 +318,9 @@ m = NULL; } + if (!m) + return NULL; + /* need to keep reference to pathspec and increment refcount because * failures array stores pointers to the pattern strings of the * pathspec that had no matches diff -Nru libgit2-0.22.2/src/pool.c libgit2-0.23.1/src/pool.c --- libgit2-0.22.2/src/pool.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/pool.c 2015-08-03 18:07:35.000000000 +0000 @@ -107,21 +107,22 @@ static void *pool_alloc_page(git_pool *pool, uint32_t size) { git_pool_page *page; - uint32_t alloc_size; + uint32_t new_page_size; + size_t alloc_size; if (size <= pool->page_size) - alloc_size = pool->page_size; + new_page_size = pool->page_size; else { - alloc_size = size; + new_page_size = size; pool->has_large_page_alloc = 1; } - page = git__calloc(1, alloc_size + sizeof(git_pool_page)); - if (!page) + if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) || + !(page = git__calloc(1, alloc_size))) return NULL; - page->size = alloc_size; - page->avail = alloc_size - size; + page->size = new_page_size; + page->avail = new_page_size - size; if (page->avail > 0) pool_insert_page(pool, page); @@ -225,7 +226,7 @@ void *ptr; size_t len_a, len_b; - assert(pool && a && b && pool->item_size == sizeof(char)); + assert(pool && pool->item_size == sizeof(char)); len_a = a ? strlen(a) : 0; len_b = b ? strlen(b) : 0; diff -Nru libgit2-0.22.2/src/posix.c libgit2-0.23.1/src/posix.c --- libgit2-0.22.2/src/posix.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/posix.c 2015-08-03 18:07:35.000000000 +0000 @@ -155,6 +155,14 @@ { char *b = buf; + if (!git__is_ssizet(cnt)) { +#ifdef GIT_WIN32 + SetLastError(ERROR_INVALID_PARAMETER); +#endif + errno = EINVAL; + return -1; + } + while (cnt) { ssize_t r; #ifdef GIT_WIN32 @@ -229,7 +237,9 @@ out->data = malloc(len); GITERR_CHECK_ALLOC(out->data); - if ((p_lseek(fd, offset, SEEK_SET) < 0) || ((size_t)p_read(fd, out->data, len) != len)) { + if (!git__is_ssizet(len) || + (p_lseek(fd, offset, SEEK_SET) < 0) || + (p_read(fd, out->data, len) != (ssize_t)len)) { giterr_set(GITERR_OS, "mmap emulation failed"); return -1; } diff -Nru libgit2-0.22.2/src/posix.h libgit2-0.23.1/src/posix.h --- libgit2-0.22.2/src/posix.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/posix.h 2015-08-03 18:07:35.000000000 +0000 @@ -122,7 +122,6 @@ #include "strnlen.h" #ifdef NO_READDIR_R -# include GIT_INLINE(int) p_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) { GIT_UNUSED(entry); diff -Nru libgit2-0.22.2/src/push.c libgit2-0.23.1/src/push.c --- libgit2-0.22.2/src/push.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/push.c 2015-08-03 18:07:35.000000000 +0000 @@ -54,6 +54,13 @@ return -1; } + if (git_vector_init(&p->updates, 0, NULL) < 0) { + git_vector_free(&p->status); + git_vector_free(&p->specs); + git__free(p); + return -1; + } + *out = p; return 0; } @@ -70,25 +77,6 @@ return 0; } -int git_push_set_callbacks( - git_push *push, - git_packbuilder_progress pack_progress_cb, - void *pack_progress_cb_payload, - git_push_transfer_progress transfer_progress_cb, - void *transfer_progress_cb_payload) -{ - if (!push) - return -1; - - push->pack_progress_cb = pack_progress_cb; - push->pack_progress_cb_payload = pack_progress_cb_payload; - - push->transfer_progress_cb = transfer_progress_cb; - push->transfer_progress_cb_payload = transfer_progress_cb_payload; - - return 0; -} - static void free_refspec(push_spec *spec) { if (spec == NULL) @@ -167,10 +155,7 @@ return 0; } -int git_push_update_tips( - git_push *push, - const git_signature *signature, - const char *reflog_message) +int git_push_update_tips(git_push *push, const git_remote_callbacks *callbacks) { git_buf remote_ref_name = GIT_BUF_INIT; size_t i, j; @@ -183,6 +168,10 @@ git_vector_foreach(&push->status, i, status) { int fire_callback = 1; + /* Skip unsuccessful updates which have non-empty messages */ + if (status->msg) + continue; + /* Find the corresponding remote ref */ fetch_spec = git_remote__matching_refspec(push->remote, status->ref); if (!fetch_spec) @@ -201,21 +190,18 @@ if (j == push->specs.length) continue; - /* If this ref update was successful (ok, not ng), it will have an empty message */ - if (status->msg == NULL) { - /* Update the remote ref */ - if (git_oid_iszero(&push_spec->loid)) { - error = git_reference_lookup(&remote_ref, push->remote->repo, git_buf_cstr(&remote_ref_name)); - - if (error >= 0) { - error = git_reference_delete(remote_ref); - git_reference_free(remote_ref); - } - } else { - error = git_reference_create(NULL, push->remote->repo, - git_buf_cstr(&remote_ref_name), &push_spec->loid, 1, signature, - reflog_message ? reflog_message : "update by push"); + /* Update the remote ref */ + if (git_oid_iszero(&push_spec->loid)) { + error = git_reference_lookup(&remote_ref, push->remote->repo, git_buf_cstr(&remote_ref_name)); + + if (error >= 0) { + error = git_reference_delete(remote_ref); + git_reference_free(remote_ref); } + } else { + error = git_reference_create(NULL, push->remote->repo, + git_buf_cstr(&remote_ref_name), &push_spec->loid, 1, + "update by push"); } if (error < 0) { @@ -226,9 +212,9 @@ fire_callback = 0; } - if (fire_callback && push->remote->callbacks.update_tips) { - error = push->remote->callbacks.update_tips(git_buf_cstr(&remote_ref_name), - &push_spec->roid, &push_spec->loid, push->remote->callbacks.payload); + if (fire_callback && callbacks && callbacks->update_tips) { + error = callbacks->update_tips(git_buf_cstr(&remote_ref_name), + &push_spec->roid, &push_spec->loid, callbacks->payload); if (error < 0) goto on_error; @@ -536,6 +522,23 @@ return error; } +static int add_update(git_push *push, push_spec *spec) +{ + git_push_update *u = git__calloc(1, sizeof(git_push_update)); + GITERR_CHECK_ALLOC(u); + + u->src_refname = git__strdup(spec->refspec.src); + GITERR_CHECK_ALLOC(u->src_refname); + + u->dst_refname = git__strdup(spec->refspec.dst); + GITERR_CHECK_ALLOC(u->dst_refname); + + git_oid_cpy(&u->src, &spec->roid); + git_oid_cpy(&u->dst, &spec->loid); + + return git_vector_insert(&push->updates, u); +} + static int calculate_work(git_push *push) { git_remote_head *head; @@ -561,12 +564,15 @@ break; } } + + if (add_update(push, spec) < 0) + return -1; } return 0; } -static int do_push(git_push *push) +static int do_push(git_push *push, const git_remote_callbacks *callbacks) { int error = 0; git_transport *transport = push->remote->transport; @@ -588,13 +594,20 @@ git_packbuilder_set_threads(push->pb, push->pb_parallelism); - if (push->pack_progress_cb) - if ((error = git_packbuilder_set_callbacks(push->pb, push->pack_progress_cb, push->pack_progress_cb_payload)) < 0) + if (callbacks && callbacks->pack_progress) + if ((error = git_packbuilder_set_callbacks(push->pb, callbacks->pack_progress, callbacks->payload)) < 0) goto on_error; - if ((error = calculate_work(push)) < 0 || - (error = queue_objects(push)) < 0 || - (error = transport->push(transport, push)) < 0) + if ((error = calculate_work(push)) < 0) + goto on_error; + + if (callbacks && callbacks->push_negotiation && + (error = callbacks->push_negotiation((const git_push_update **) push->updates.contents, + push->updates.length, callbacks->payload)) < 0) + goto on_error; + + if ((error = queue_objects(push)) < 0 || + (error = transport->push(transport, push, callbacks)) < 0) goto on_error; on_error: @@ -620,16 +633,16 @@ return 0; } -int git_push_finish(git_push *push) +int git_push_finish(git_push *push, const git_remote_callbacks *callbacks) { int error; if (!git_remote_connected(push->remote) && - (error = git_remote_connect(push->remote, GIT_DIRECTION_PUSH)) < 0) + (error = git_remote_connect(push->remote, GIT_DIRECTION_PUSH, callbacks)) < 0) return error; if ((error = filter_refs(push->remote)) < 0 || - (error = do_push(push)) < 0) + (error = do_push(push, callbacks)) < 0) return error; if (!push->unpack_ok) { @@ -670,6 +683,7 @@ { push_spec *spec; push_status *status; + git_push_update *update; unsigned int i; if (push == NULL) @@ -685,6 +699,13 @@ } git_vector_free(&push->status); + git_vector_foreach(&push->updates, i, update) { + git__free(update->src_refname); + git__free(update->dst_refname); + git__free(update); + } + git_vector_free(&push->updates); + git__free(push); } diff -Nru libgit2-0.22.2/src/push.h libgit2-0.23.1/src/push.h --- libgit2-0.22.2/src/push.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/push.h 2015-08-03 18:07:35.000000000 +0000 @@ -29,6 +29,7 @@ git_packbuilder *pb; git_remote *remote; git_vector specs; + git_vector updates; bool report_status; /* report-status */ @@ -37,11 +38,6 @@ /* options */ unsigned pb_parallelism; - - git_packbuilder_progress pack_progress_cb; - void *pack_progress_cb_payload; - git_push_transfer_progress transfer_progress_cb; - void *transfer_progress_cb_payload; }; /** @@ -74,27 +70,6 @@ const git_push_options *opts); /** - * Set the callbacks for a push - * - * @param push The push object - * @param pack_progress_cb Function to call with progress information during - * pack building. Be aware that this is called inline with pack building - * operations, so performance may be affected. - * @param pack_progress_cb_payload Payload for the pack progress callback. - * @param transfer_progress_cb Function to call with progress information during - * the upload portion of a push. Be aware that this is called inline with - * pack building operations, so performance may be affected. - * @param transfer_progress_cb_payload Payload for the network progress callback. - * @return 0 or an error code - */ -int git_push_set_callbacks( - git_push *push, - git_packbuilder_progress pack_progress_cb, - void *pack_progress_cb_payload, - git_push_transfer_progress transfer_progress_cb, - void *transfer_progress_cb_payload); - -/** * Add a refspec to be pushed * * @param push The push object @@ -108,16 +83,11 @@ * Update remote tips after a push * * @param push The push object - * @param signature The identity to use when updating reflogs - * @param reflog_message The message to insert into the reflogs. If NULL, the - * default is "update by push". + * @param callbacks the callbacks to use for this connection * * @return 0 or an error code */ -int git_push_update_tips( - git_push *push, - const git_signature *signature, - const char *reflog_message); +int git_push_update_tips(git_push *push, const git_remote_callbacks *callbacks); /** * Perform the push @@ -130,10 +100,11 @@ * order to find out which updates were accepted or rejected. * * @param push The push object + * @param callbacks the callbacks to use for this connection * * @return 0 or an error code */ -int git_push_finish(git_push *push); +int git_push_finish(git_push *push, const git_remote_callbacks *callbacks); /** * Invoke callback `cb' on each status entry @@ -147,6 +118,7 @@ * * @param push The push object * @param cb The callback to call on each object + * @param data The payload passed to the callback * * @return 0 on success, non-zero callback return value, or error code */ diff -Nru libgit2-0.22.2/src/rebase.c libgit2-0.23.1/src/rebase.c --- libgit2-0.22.2/src/rebase.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/rebase.c 2015-08-03 18:07:35.000000000 +0000 @@ -14,6 +14,7 @@ #include "array.h" #include "config.h" #include "annotated_commit.h" +#include "index.h" #include #include @@ -56,6 +57,8 @@ struct git_rebase { git_repository *repo; + git_rebase_options options; + git_rebase_type_t type; char *state_path; @@ -168,10 +171,31 @@ return 0; } +static git_rebase_operation *rebase_operation_alloc( + git_rebase *rebase, + git_rebase_operation_t type, + git_oid *id, + const char *exec) +{ + git_rebase_operation *operation; + + assert((type == GIT_REBASE_OPERATION_EXEC) == !id); + assert((type == GIT_REBASE_OPERATION_EXEC) == !!exec); + + if ((operation = git_array_alloc(rebase->operations)) == NULL) + return NULL; + + operation->type = type; + git_oid_cpy((git_oid *)&operation->id, id); + operation->exec = exec; + + return operation; +} + static int rebase_open_merge(git_rebase *rebase) { git_buf state_path = GIT_BUF_INIT, buf = GIT_BUF_INIT, cmt = GIT_BUF_INIT; - git_oid current_id = {{0}}; + git_oid id; git_rebase_operation *operation; size_t i, msgnum = 0, end; int error; @@ -194,7 +218,7 @@ goto done; /* Read 'current' if it exists */ - if ((error = rebase_readoid(¤t_id, &buf, &state_path, CURRENT_FILE)) < 0 && + if ((error = rebase_readoid(&id, &buf, &state_path, CURRENT_FILE)) < 0 && error != GIT_ENOTFOUND) goto done; @@ -203,14 +227,14 @@ GITERR_CHECK_ARRAY(rebase->operations); for (i = 0; i < end; i++) { - operation = git_array_alloc(rebase->operations); - GITERR_CHECK_ALLOC(operation); - git_buf_clear(&cmt); if ((error = git_buf_printf(&cmt, "cmt.%" PRIuZ, (i+1))) < 0 || - (error = rebase_readoid((git_oid *)&operation->id, &buf, &state_path, cmt.ptr)) < 0) + (error = rebase_readoid(&id, &buf, &state_path, cmt.ptr)) < 0) goto done; + + operation = rebase_operation_alloc(rebase, GIT_REBASE_OPERATION_PICK, &id, NULL); + GITERR_CHECK_ALLOC(operation); } /* Read 'onto_name' */ @@ -227,7 +251,43 @@ return error; } -int git_rebase_open(git_rebase **out, git_repository *repo) +static git_rebase *rebase_alloc(const git_rebase_options *rebase_opts) +{ + git_rebase *rebase = git__calloc(1, sizeof(git_rebase)); + + if (!rebase) + return NULL; + + if (rebase_opts) + memcpy(&rebase->options, rebase_opts, sizeof(git_rebase_options)); + else + git_rebase_init_options(&rebase->options, GIT_REBASE_OPTIONS_VERSION); + + if (rebase_opts && rebase_opts->rewrite_notes_ref) { + if ((rebase->options.rewrite_notes_ref = git__strdup(rebase_opts->rewrite_notes_ref)) == NULL) + return NULL; + } + + if ((rebase->options.checkout_options.checkout_strategy & (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_FORCE)) == 0) + rebase->options.checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE; + + return rebase; +} + +static int rebase_check_versions(const git_rebase_options *given_opts) +{ + GITERR_CHECK_VERSION(given_opts, GIT_REBASE_OPTIONS_VERSION, "git_rebase_options"); + + if (given_opts) + GITERR_CHECK_VERSION(&given_opts->checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, "git_checkout_options"); + + return 0; +} + +int git_rebase_open( + git_rebase **out, + git_repository *repo, + const git_rebase_options *given_opts) { git_rebase *rebase; git_buf path = GIT_BUF_INIT, orig_head_name = GIT_BUF_INIT, @@ -236,7 +296,10 @@ assert(repo); - rebase = git__calloc(1, sizeof(git_rebase)); + if ((error = rebase_check_versions(given_opts)) < 0) + return error; + + rebase = rebase_alloc(given_opts); GITERR_CHECK_ALLOC(rebase); rebase->repo = repo; @@ -373,7 +436,7 @@ size_t i; int error = 0; - if ((error = rebase_setupfile(rebase, END_FILE, -1, "%d\n", git_array_size(rebase->operations))) < 0 || + if ((error = rebase_setupfile(rebase, END_FILE, -1, "%" PRIuZ "\n", git_array_size(rebase->operations))) < 0 || (error = rebase_setupfile(rebase, ONTO_NAME_FILE, -1, "%s\n", rebase->onto_name)) < 0) goto done; @@ -424,48 +487,6 @@ return 0; } -static int rebase_normalize_opts( - git_repository *repo, - git_rebase_options *opts, - const git_rebase_options *given_opts) -{ - git_rebase_options default_opts = GIT_REBASE_OPTIONS_INIT; - git_config *config; - - if (given_opts) - memcpy(opts, given_opts, sizeof(git_rebase_options)); - else - memcpy(opts, &default_opts, sizeof(git_rebase_options)); - - if (git_repository_config(&config, repo) < 0) - return -1; - - if (given_opts && given_opts->rewrite_notes_ref) { - opts->rewrite_notes_ref = git__strdup(given_opts->rewrite_notes_ref); - GITERR_CHECK_ALLOC(opts->rewrite_notes_ref); - } else if (git_config__get_bool_force(config, "notes.rewrite.rebase", 1)) { - const char *rewrite_ref = git_config__get_string_force( - config, "notes.rewriteref", NOTES_DEFAULT_REF); - - if (rewrite_ref) { - opts->rewrite_notes_ref = git__strdup(rewrite_ref); - GITERR_CHECK_ALLOC(opts->rewrite_notes_ref); - } - } - - git_config_free(config); - - return 0; -} - -static void rebase_opts_free(git_rebase_options *opts) -{ - if (!opts) - return; - - git__free((char *)opts->rewrite_notes_ref); -} - static int rebase_ensure_not_in_progress(git_repository *repo) { int error; @@ -482,33 +503,42 @@ return 0; } -static int rebase_ensure_not_dirty(git_repository *repo) +static int rebase_ensure_not_dirty( + git_repository *repo, + bool check_index, + bool check_workdir, + int fail_with) { git_tree *head = NULL; git_index *index = NULL; git_diff *diff = NULL; - int error; + int error = 0; - if ((error = git_repository_head_tree(&head, repo)) < 0 || - (error = git_repository_index(&index, repo)) < 0 || - (error = git_diff_tree_to_index(&diff, repo, head, index, NULL)) < 0) - goto done; + if (check_index) { + if ((error = git_repository_head_tree(&head, repo)) < 0 || + (error = git_repository_index(&index, repo)) < 0 || + (error = git_diff_tree_to_index(&diff, repo, head, index, NULL)) < 0) + goto done; - if (git_diff_num_deltas(diff) > 0) { - giterr_set(GITERR_REBASE, "Uncommitted changes exist in index"); - error = -1; - goto done; - } + if (git_diff_num_deltas(diff) > 0) { + giterr_set(GITERR_REBASE, "Uncommitted changes exist in index"); + error = fail_with; + goto done; + } - git_diff_free(diff); - diff = NULL; + git_diff_free(diff); + diff = NULL; + } - if ((error = git_diff_index_to_workdir(&diff, repo, index, NULL)) < 0) - goto done; + if (check_workdir) { + if ((error = git_diff_index_to_workdir(&diff, repo, index, NULL)) < 0) + goto done; - if (git_diff_num_deltas(diff) > 0) { - giterr_set(GITERR_REBASE, "Unstaged changes exist in workdir"); - error = -1; + if (git_diff_num_deltas(diff) > 0) { + giterr_set(GITERR_REBASE, "Unstaged changes exist in workdir"); + error = fail_with; + goto done; + } } done: @@ -553,9 +583,8 @@ if (merge) continue; - operation = git_array_alloc(rebase->operations); - operation->type = GIT_REBASE_OPERATION_PICK; - git_oid_cpy((git_oid *)&operation->id, &id); + operation = rebase_operation_alloc(rebase, GIT_REBASE_OPERATION_PICK, &id, NULL); + GITERR_CHECK_ALLOC(operation); } error = 0; @@ -586,20 +615,29 @@ git_repository *repo, const git_annotated_commit *branch, const git_annotated_commit *upstream, - const git_annotated_commit *onto, - const git_rebase_options *opts) + const git_annotated_commit *onto) { + git_reference *head_ref = NULL; + git_annotated_commit *head_branch = NULL; git_buf state_path = GIT_BUF_INIT; int error; if ((error = git_buf_joinpath(&state_path, repo->path_repository, REBASE_MERGE_DIR)) < 0) - return error; + goto done; + + if (!branch) { + if ((error = git_repository_head(&head_ref, repo)) < 0 || + (error = git_annotated_commit_from_ref(&head_branch, repo, head_ref)) < 0) + goto done; + + branch = head_branch; + } rebase->repo = repo; rebase->type = GIT_REBASE_TYPE_MERGE; rebase->state_path = git_buf_detach(&state_path); rebase->orig_head_name = git__strdup(branch->ref_name ? branch->ref_name : ORIG_DETACHED_HEAD); - rebase->quiet = opts->quiet; + rebase->quiet = rebase->options.quiet; git_oid_cpy(&rebase->orig_head_id, git_annotated_commit_id(branch)); git_oid_cpy(&rebase->onto_id, git_annotated_commit_id(onto)); @@ -611,6 +649,10 @@ git_buf_free(&state_path); +done: + git_reference_free(head_ref); + git_annotated_commit_free(head_branch); + return error; } @@ -620,74 +662,63 @@ const git_annotated_commit *branch, const git_annotated_commit *upstream, const git_annotated_commit *onto, - const git_signature *signature, const git_rebase_options *given_opts) { git_rebase *rebase = NULL; - git_rebase_options opts; - git_reference *head_ref = NULL; git_buf reflog = GIT_BUF_INIT; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + git_commit *onto_commit = NULL; + git_reference *head_ref = NULL; int error; - assert(repo && branch && (upstream || onto)); + assert(repo && (upstream || onto)); *out = NULL; - GITERR_CHECK_VERSION(given_opts, GIT_REBASE_OPTIONS_VERSION, "git_rebase_options"); - if (!onto) onto = upstream; - checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; - - if ((error = rebase_normalize_opts(repo, &opts, given_opts)) < 0 || + if ((error = rebase_check_versions(given_opts)) < 0 || (error = git_repository__ensure_not_bare(repo, "rebase")) < 0 || (error = rebase_ensure_not_in_progress(repo)) < 0 || - (error = rebase_ensure_not_dirty(repo)) < 0) + (error = rebase_ensure_not_dirty(repo, true, true, GIT_ERROR)) < 0 || + (error = git_commit_lookup( + &onto_commit, repo, git_annotated_commit_id(onto))) < 0) return error; - rebase = git__calloc(1, sizeof(git_rebase)); - GITERR_CHECK_ALLOC(rebase); + rebase = rebase_alloc(given_opts); - if ((error = rebase_init(rebase, repo, branch, upstream, onto, &opts)) < 0 || + if ((error = rebase_init( + rebase, repo, branch, upstream, onto)) < 0 || (error = rebase_setupfiles(rebase)) < 0 || (error = git_buf_printf(&reflog, "rebase: checkout %s", rebase_onto_name(onto))) < 0 || + (error = git_checkout_tree( + repo, (git_object *)onto_commit, &rebase->options.checkout_options)) < 0 || (error = git_reference_create(&head_ref, repo, GIT_HEAD_FILE, - git_annotated_commit_id(onto), 1, signature, reflog.ptr)) < 0 || - (error = git_checkout_head(repo, &checkout_opts)) < 0) + git_annotated_commit_id(onto), 1, reflog.ptr)) < 0) goto done; *out = rebase; done: + git_reference_free(head_ref); if (error < 0) { rebase_cleanup(rebase); git_rebase_free(rebase); } - git_reference_free(head_ref); + git_commit_free(onto_commit); git_buf_free(&reflog); - rebase_opts_free(&opts); return error; } -static void normalize_checkout_opts( - git_rebase *rebase, - git_commit *current_commit, +static void normalize_checkout_options_for_apply( git_checkout_options *checkout_opts, - const git_checkout_options *given_checkout_opts) + git_rebase *rebase, + git_commit *current_commit) { - if (given_checkout_opts != NULL) - memcpy(checkout_opts, given_checkout_opts, sizeof(git_checkout_options)); - else { - git_checkout_options default_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; - default_checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - - memcpy(checkout_opts, &default_checkout_opts, sizeof(git_checkout_options)); - } + memcpy(checkout_opts, &rebase->options.checkout_options, sizeof(git_checkout_options)); if (!checkout_opts->ancestor_label) checkout_opts->ancestor_label = "ancestor"; @@ -718,15 +749,15 @@ static int rebase_next_merge( git_rebase_operation **out, - git_rebase *rebase, - git_checkout_options *given_checkout_opts) + git_rebase *rebase) { git_buf path = GIT_BUF_INIT; - git_checkout_options checkout_opts = {0}; git_commit *current_commit = NULL, *parent_commit = NULL; git_tree *current_tree = NULL, *head_tree = NULL, *parent_tree = NULL; git_index *index = NULL; + git_indexwriter indexwriter = GIT_INDEXWRITER_INIT; git_rebase_operation *operation; + git_checkout_options checkout_opts; char current_idstr[GIT_OID_HEXSZ]; unsigned int parent_count; int error; @@ -755,20 +786,21 @@ git_oid_fmt(current_idstr, &operation->id); - if ((error = rebase_setupfile(rebase, MSGNUM_FILE, -1, "%d\n", rebase->current+1)) < 0 || - (error = rebase_setupfile(rebase, CURRENT_FILE, -1, "%.*s\n", GIT_OID_HEXSZ, current_idstr)) < 0) - goto done; - - normalize_checkout_opts(rebase, current_commit, &checkout_opts, given_checkout_opts); + normalize_checkout_options_for_apply(&checkout_opts, rebase, current_commit); - if ((error = git_merge_trees(&index, rebase->repo, parent_tree, head_tree, current_tree, NULL)) < 0 || + if ((error = git_indexwriter_init_for_operation(&indexwriter, rebase->repo, &checkout_opts.checkout_strategy)) < 0 || + (error = rebase_setupfile(rebase, MSGNUM_FILE, -1, "%" PRIuZ "\n", rebase->current+1)) < 0 || + (error = rebase_setupfile(rebase, CURRENT_FILE, -1, "%.*s\n", GIT_OID_HEXSZ, current_idstr)) < 0 || + (error = git_merge_trees(&index, rebase->repo, parent_tree, head_tree, current_tree, NULL)) < 0 || (error = git_merge__check_result(rebase->repo, index)) < 0 || - (error = git_checkout_index(rebase->repo, index, &checkout_opts)) < 0) + (error = git_checkout_index(rebase->repo, index, &checkout_opts)) < 0 || + (error = git_indexwriter_commit(&indexwriter)) < 0) goto done; *out = operation; done: + git_indexwriter_cleanup(&indexwriter); git_index_free(index); git_tree_free(current_tree); git_tree_free(head_tree); @@ -782,8 +814,7 @@ int git_rebase_next( git_rebase_operation **out, - git_rebase *rebase, - git_checkout_options *checkout_opts) + git_rebase *rebase) { int error; @@ -791,7 +822,7 @@ switch (rebase->type) { case GIT_REBASE_TYPE_MERGE: - error = rebase_next_merge(out, rebase, checkout_opts); + error = rebase_next_merge(out, rebase); break; default: abort(); @@ -827,11 +858,12 @@ if (git_index_has_conflicts(index)) { giterr_set(GITERR_REBASE, "Conflicts have not been resolved"); - error = GIT_EMERGECONFLICT; + error = GIT_EUNMERGED; goto done; } - if ((error = git_commit_lookup(¤t_commit, rebase->repo, &operation->id)) < 0 || + if ((error = rebase_ensure_not_dirty(rebase->repo, false, true, GIT_EUNMERGED)) < 0 || + (error = git_commit_lookup(¤t_commit, rebase->repo, &operation->id)) < 0 || (error = git_repository_head(&head, rebase->repo)) < 0 || (error = git_reference_peel((git_object **)&head_commit, head, GIT_OBJ_COMMIT)) < 0 || (error = git_commit_tree(&head_tree, head_commit)) < 0 || @@ -861,7 +893,7 @@ (const git_commit **)&head_commit)) < 0 || (error = git_commit_lookup(&commit, rebase->repo, commit_id)) < 0 || (error = git_reference__update_for_commit( - rebase->repo, NULL, "HEAD", commit_id, committer, "rebase")) < 0) + rebase->repo, NULL, "HEAD", commit_id, "rebase")) < 0) goto done; git_oid_fmt(old_idstr, git_commit_id(current_commit)); @@ -908,20 +940,20 @@ return error; } -int git_rebase_abort(git_rebase *rebase, const git_signature *signature) +int git_rebase_abort(git_rebase *rebase) { git_reference *orig_head_ref = NULL; git_commit *orig_head_commit = NULL; int error; - assert(rebase && signature); + assert(rebase); error = rebase->head_detached ? git_reference_create(&orig_head_ref, rebase->repo, GIT_HEAD_FILE, - &rebase->orig_head_id, 1, signature, "rebase: aborting") : + &rebase->orig_head_id, 1, "rebase: aborting") : git_reference_symbolic_create( &orig_head_ref, rebase->repo, GIT_HEAD_FILE, rebase->orig_head_name, 1, - signature, "rebase: aborting"); + "rebase: aborting"); if (error < 0) goto done; @@ -929,7 +961,7 @@ if ((error = git_commit_lookup( &orig_head_commit, rebase->repo, &rebase->orig_head_id)) < 0 || (error = git_reset(rebase->repo, (git_object *)orig_head_commit, - GIT_RESET_HARD, NULL, signature, NULL)) < 0) + GIT_RESET_HARD, &rebase->options.checkout_options)) < 0) goto done; error = rebase_cleanup(rebase); @@ -941,19 +973,50 @@ return error; } +static int notes_ref_lookup(git_buf *out, git_rebase *rebase) +{ + git_config *config = NULL; + int do_rewrite, error; + + if (rebase->options.rewrite_notes_ref) { + git_buf_attach_notowned(out, + rebase->options.rewrite_notes_ref, + strlen(rebase->options.rewrite_notes_ref)); + return 0; + } + + if ((error = git_repository_config(&config, rebase->repo)) < 0 || + (error = git_config_get_bool(&do_rewrite, config, "notes.rewrite.rebase")) < 0) { + + if (error != GIT_ENOTFOUND) + goto done; + + giterr_clear(); + do_rewrite = 1; + } + + error = do_rewrite ? + git_config_get_string_buf(out, config, "notes.rewriteref") : + GIT_ENOTFOUND; + +done: + git_config_free(config); + return error; +} + static int rebase_copy_note( git_rebase *rebase, + const char *notes_ref, git_oid *from, git_oid *to, - const git_signature *committer, - const git_rebase_options *opts) + const git_signature *committer) { git_note *note = NULL; git_oid note_id; git_signature *who = NULL; int error; - if ((error = git_note_read(¬e, rebase->repo, opts->rewrite_notes_ref, from)) < 0) { + if ((error = git_note_read(¬e, rebase->repo, notes_ref, from)) < 0) { if (error == GIT_ENOTFOUND) { giterr_clear(); error = 0; @@ -974,7 +1037,7 @@ committer = who; } - error = git_note_create(¬e_id, rebase->repo, opts->rewrite_notes_ref, + error = git_note_create(¬e_id, rebase->repo, notes_ref, git_note_author(note), committer, to, git_note_message(note), 0); done: @@ -986,17 +1049,22 @@ static int rebase_copy_notes( git_rebase *rebase, - const git_signature *committer, - const git_rebase_options *opts) + const git_signature *committer) { - git_buf path = GIT_BUF_INIT, rewritten = GIT_BUF_INIT; + git_buf path = GIT_BUF_INIT, rewritten = GIT_BUF_INIT, notes_ref = GIT_BUF_INIT; char *pair_list, *fromstr, *tostr, *end; git_oid from, to; unsigned int linenum = 1; int error = 0; - if (!opts->rewrite_notes_ref) + if ((error = notes_ref_lookup(¬es_ref, rebase)) < 0) { + if (error == GIT_ENOTFOUND) { + giterr_clear(); + error = 0; + } + goto done; + } if ((error = git_buf_joinpath(&path, rebase->state_path, REWRITTEN_FILE)) < 0 || (error = git_futils_readbuffer(&rewritten, path.ptr)) < 0) @@ -1025,7 +1093,7 @@ git_oid_fromstr(&to, tostr) < 0) goto on_error; - if ((error = rebase_copy_note(rebase, &from, &to, committer, opts)) < 0) + if ((error = rebase_copy_note(rebase, notes_ref.ptr, &from, &to, committer)) < 0) goto done; linenum++; @@ -1040,16 +1108,15 @@ done: git_buf_free(&rewritten); git_buf_free(&path); + git_buf_free(¬es_ref); return error; } int git_rebase_finish( git_rebase *rebase, - const git_signature *signature, - const git_rebase_options *given_opts) + const git_signature *signature) { - git_rebase_options opts; git_reference *terminal_ref = NULL, *branch_ref = NULL, *head_ref = NULL; git_commit *terminal_commit = NULL; git_buf branch_msg = GIT_BUF_INIT, head_msg = GIT_BUF_INIT; @@ -1058,11 +1125,6 @@ assert(rebase); - GITERR_CHECK_VERSION(given_opts, GIT_REBASE_OPTIONS_VERSION, "git_rebase_options"); - - if ((error = rebase_normalize_opts(rebase->repo, &opts, given_opts)) < 0) - goto done; - git_oid_fmt(onto, &rebase->onto_id); if ((error = git_buf_printf(&branch_msg, "rebase finished: %s onto %.*s", @@ -1074,11 +1136,11 @@ terminal_ref, GIT_OBJ_COMMIT)) < 0 || (error = git_reference_create_matching(&branch_ref, rebase->repo, rebase->orig_head_name, git_commit_id(terminal_commit), 1, - &rebase->orig_head_id, signature, branch_msg.ptr)) < 0 || + &rebase->orig_head_id, branch_msg.ptr)) < 0 || (error = git_reference_symbolic_create(&head_ref, rebase->repo, GIT_HEAD_FILE, rebase->orig_head_name, 1, - signature, head_msg.ptr)) < 0 || - (error = rebase_copy_notes(rebase, signature, &opts)) < 0) + head_msg.ptr)) < 0 || + (error = rebase_copy_notes(rebase, signature)) < 0) goto done; error = rebase_cleanup(rebase); @@ -1090,7 +1152,6 @@ git_reference_free(head_ref); git_reference_free(branch_ref); git_reference_free(terminal_ref); - rebase_opts_free(&opts); return error; } @@ -1106,7 +1167,7 @@ { assert(rebase); - return rebase->current; + return rebase->started ? rebase->current : GIT_REBASE_NO_OPERATION; } git_rebase_operation *git_rebase_operation_byindex(git_rebase *rebase, size_t idx) @@ -1125,5 +1186,6 @@ git__free(rebase->orig_head_name); git__free(rebase->state_path); git_array_clear(rebase->operations); + git__free((char *)rebase->options.rewrite_notes_ref); git__free(rebase); } diff -Nru libgit2-0.22.2/src/refdb_fs.c libgit2-0.23.1/src/refdb_fs.c --- libgit2-0.22.2/src/refdb_fs.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/refdb_fs.c 2015-08-03 18:07:35.000000000 +0000 @@ -26,7 +26,7 @@ #include #include -GIT__USE_STRMAP; +GIT__USE_STRMAP #define DEFAULT_NESTING_LEVEL 5 #define MAX_NESTING_LEVEL 10 @@ -1324,7 +1324,7 @@ /* Try to rename the refog; it's ok if the old doesn't exist */ error = refdb_reflog_fs__rename(_backend, old_name, new_name); if (((error == 0) || (error == GIT_ENOTFOUND)) && - ((error = reflog_append(backend, new, NULL, NULL, who, message)) < 0)) { + ((error = reflog_append(backend, new, git_reference_target(new), NULL, who, message)) < 0)) { git_reference_free(new); git_filebuf_cleanup(&file); return error; diff -Nru libgit2-0.22.2/src/reflog.c libgit2-0.23.1/src/reflog.c --- libgit2-0.22.2/src/reflog.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/reflog.c 2015-08-03 18:07:35.000000000 +0000 @@ -193,7 +193,7 @@ entry = (git_reflog_entry *)git_reflog_entry_byindex(reflog, idx); if (entry == NULL) { - giterr_set(GITERR_REFERENCE, "No reflog entry at index "PRIuZ, idx); + giterr_set(GITERR_REFERENCE, "No reflog entry at index %"PRIuZ, idx); return GIT_ENOTFOUND; } diff -Nru libgit2-0.22.2/src/refs.c libgit2-0.23.1/src/refs.c --- libgit2-0.22.2/src/refs.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/refs.c 2015-08-03 18:07:35.000000000 +0000 @@ -24,7 +24,7 @@ #include #include -GIT__USE_STRMAP; +GIT__USE_STRMAP #define DEFAULT_NESTING_LEVEL 5 #define MAX_NESTING_LEVEL 10 @@ -36,13 +36,13 @@ static git_reference *alloc_ref(const char *name) { - git_reference *ref; - size_t namelen = strlen(name); - - if ((ref = git__calloc(1, sizeof(git_reference) + namelen + 1)) == NULL) - return NULL; + git_reference *ref = NULL; + size_t namelen = strlen(name), reflen; - memcpy(ref->name, name, namelen + 1); + if (!GIT_ADD_SIZET_OVERFLOW(&reflen, sizeof(git_reference), namelen) && + !GIT_ADD_SIZET_OVERFLOW(&reflen, reflen, 1) && + (ref = git__calloc(1, reflen)) != NULL) + memcpy(ref->name, name, namelen + 1); return ref; } @@ -94,10 +94,14 @@ git_reference *ref, const char *name) { size_t namelen = strlen(name); - git_reference *rewrite = - git__realloc(ref, sizeof(git_reference) + namelen + 1); - if (rewrite != NULL) + size_t reflen; + git_reference *rewrite = NULL; + + if (!GIT_ADD_SIZET_OVERFLOW(&reflen, sizeof(git_reference), namelen) && + !GIT_ADD_SIZET_OVERFLOW(&reflen, reflen, 1) && + (rewrite = git__realloc(ref, reflen)) != NULL) memcpy(rewrite->name, name, namelen + 1); + return rewrite; } @@ -412,12 +416,22 @@ return 0; } +int configured_ident(git_signature **out, const git_repository *repo) +{ + if (repo->ident_name && repo->ident_email) + return git_signature_now(out, repo->ident_name, repo->ident_email); + + /* if not configured let us fall-through to the next method */ + return -1; +} + int git_reference__log_signature(git_signature **out, git_repository *repo) { int error; git_signature *who; - if(((error = git_signature_default(&who, repo)) < 0) && + if(((error = configured_ident(&who, repo)) < 0) && + ((error = git_signature_default(&who, repo)) < 0) && ((error = git_signature_now(&who, "unknown", "unknown")) < 0)) return error; @@ -432,7 +446,6 @@ const git_oid *id, int force, const git_oid *old_id, - const git_signature *signature, const char *log_message) { @@ -441,15 +454,11 @@ assert(id); - if (!signature) { - if ((error = git_reference__log_signature(&who, repo)) < 0) - return error; - else - signature = who; - } + if ((error = git_reference__log_signature(&who, repo)) < 0) + return error; error = reference__create( - ref_out, repo, name, id, NULL, force, signature, log_message, old_id, NULL); + ref_out, repo, name, id, NULL, force, who, log_message, old_id, NULL); git_signature_free(who); return error; @@ -461,10 +470,9 @@ const char *name, const git_oid *id, int force, - const git_signature *signature, const char *log_message) { - return git_reference_create_matching(ref_out, repo, name, id, force, NULL, signature, log_message); + return git_reference_create_matching(ref_out, repo, name, id, force, NULL, log_message); } int git_reference_symbolic_create_matching( @@ -474,7 +482,6 @@ const char *target, int force, const char *old_target, - const git_signature *signature, const char *log_message) { int error; @@ -482,15 +489,11 @@ assert(target); - if (!signature) { - if ((error = git_reference__log_signature(&who, repo)) < 0) - return error; - else - signature = who; - } + if ((error = git_reference__log_signature(&who, repo)) < 0) + return error; error = reference__create( - ref_out, repo, name, NULL, target, force, signature, log_message, NULL, old_target); + ref_out, repo, name, NULL, target, force, who, log_message, NULL, old_target); git_signature_free(who); return error; @@ -502,10 +505,9 @@ const char *name, const char *target, int force, - const git_signature *signature, const char *log_message) { - return git_reference_symbolic_create_matching(ref_out, repo, name, target, force, NULL, signature, log_message); + return git_reference_symbolic_create_matching(ref_out, repo, name, target, force, NULL, log_message); } static int ensure_is_an_updatable_direct_reference(git_reference *ref) @@ -521,7 +523,6 @@ git_reference **out, git_reference *ref, const git_oid *id, - const git_signature *signature, const char *log_message) { int error; @@ -534,7 +535,7 @@ if ((error = ensure_is_an_updatable_direct_reference(ref)) < 0) return error; - return git_reference_create_matching(out, repo, ref->name, id, 1, &ref->target.oid, signature, log_message); + return git_reference_create_matching(out, repo, ref->name, id, 1, &ref->target.oid, log_message); } static int ensure_is_an_updatable_symbolic_reference(git_reference *ref) @@ -550,7 +551,6 @@ git_reference **out, git_reference *ref, const char *target, - const git_signature *signature, const char *log_message) { int error; @@ -561,7 +561,7 @@ return error; return git_reference_symbolic_create_matching( - out, ref->db->repo, ref->name, target, 1, ref->target.symbolic, signature, log_message); + out, ref->db->repo, ref->name, target, 1, ref->target.symbolic, log_message); } static int reference__rename(git_reference **out, git_reference *ref, const char *new_name, int force, @@ -589,7 +589,7 @@ /* Update HEAD it was pointing to the reference being renamed */ if (should_head_be_updated && - (error = git_repository_set_head(ref->db->repo, normalized, signature, message)) < 0) { + (error = git_repository_set_head(ref->db->repo, normalized)) < 0) { giterr_set(GITERR_REFERENCE, "Failed to update HEAD after renaming reference"); return error; } @@ -603,23 +603,16 @@ git_reference *ref, const char *new_name, int force, - const git_signature *signature, const char *log_message) { - git_signature *who = (git_signature*)signature; + git_signature *who; int error; - /* Should we return an error if there is no default? */ - if (!who && - ((error = git_signature_default(&who, ref->db->repo)) < 0) && - ((error = git_signature_now(&who, "unknown", "unknown")) < 0)) { + if ((error = git_reference__log_signature(&who, ref->db->repo)) < 0) return error; - } error = reference__rename(out, ref, new_name, force, who, log_message); - - if (!signature) - git_signature_free(who); + git_signature_free(who); return error; } @@ -870,7 +863,7 @@ const char *name, unsigned int flags) { - char *current; + const char *current; int segment_len, segments_count = 0, error = GIT_EINVALIDSPEC; unsigned int process_flags; bool normalize = (buf != NULL); @@ -1034,13 +1027,11 @@ return git_oid__cmp(&ref1->target.oid, &ref2->target.oid); } -static int reference__update_terminal( - git_repository *repo, - const char *ref_name, - const git_oid *oid, - int nesting, - const git_signature *signature, - const char *log_message) +/** + * Get the end of a chain of references. If the final one is not + * found, we return the reference just before that. + */ +static int get_terminal(git_reference **out, git_repository *repo, const char *ref_name, int nesting) { git_reference *ref; int error = 0; @@ -1050,27 +1041,21 @@ return GIT_ENOTFOUND; } - error = git_reference_lookup(&ref, repo, ref_name); - - /* If we haven't found the reference at all, create a new reference. */ - if (error == GIT_ENOTFOUND) { - giterr_clear(); - return git_reference_create(NULL, repo, ref_name, oid, 0, signature, log_message); - } - - if (error < 0) + /* set to NULL to let the caller know that they're at the end of the chain */ + if ((error = git_reference_lookup(&ref, repo, ref_name)) < 0) { + *out = NULL; return error; + } - /* If the ref is a symbolic reference, follow its target. */ - if (git_reference_type(ref) == GIT_REF_SYMBOLIC) { - error = reference__update_terminal(repo, git_reference_symbolic_target(ref), oid, - nesting+1, signature, log_message); - git_reference_free(ref); + if (git_reference_type(ref) == GIT_REF_OID) { + *out = ref; + error = 0; } else { - /* If we're not moving the target, don't recreate the ref */ - if (0 != git_oid_cmp(git_reference_target(ref), oid)) - error = git_reference_create(NULL, repo, ref_name, oid, 1, signature, log_message); - git_reference_free(ref); + error = get_terminal(out, repo, git_reference_symbolic_target(ref), nesting + 1); + if (error == GIT_ENOTFOUND && !*out) + *out = ref; + else + git_reference_free(ref); } return error; @@ -1085,10 +1070,40 @@ git_repository *repo, const char *ref_name, const git_oid *oid, - const git_signature *signature, + const git_signature *sig, const char *log_message) { - return reference__update_terminal(repo, ref_name, oid, 0, signature, log_message); + git_reference *ref = NULL, *ref2 = NULL; + git_signature *who = NULL; + const git_signature *to_use; + int error = 0; + + if (!sig && (error = git_reference__log_signature(&who, repo)) < 0) + return error; + + to_use = sig ? sig : who; + error = get_terminal(&ref, repo, ref_name, 0); + + /* found a dangling symref */ + if (error == GIT_ENOTFOUND && ref) { + assert(git_reference_type(ref) == GIT_REF_SYMBOLIC); + giterr_clear(); + error = reference__create(&ref2, repo, ref->target.symbolic, oid, NULL, 0, to_use, + log_message, NULL, NULL); + } else if (error == GIT_ENOTFOUND) { + giterr_clear(); + error = reference__create(&ref2, repo, ref_name, oid, NULL, 0, to_use, + log_message, NULL, NULL); + } else if (error == 0) { + assert(git_reference_type(ref) == GIT_REF_OID); + error = reference__create(&ref2, repo, ref->name, oid, NULL, 1, to_use, + log_message, &ref->target.oid, NULL); + } + + git_reference_free(ref2); + git_reference_free(ref); + git_signature_free(who); + return error; } int git_reference__update_for_commit( @@ -1096,12 +1111,12 @@ git_reference *ref, const char *ref_name, const git_oid *id, - const git_signature *committer, const char *operation) { git_reference *ref_new = NULL; git_commit *commit = NULL; git_buf reflog_msg = GIT_BUF_INIT; + const git_signature *who; int error; if ((error = git_commit_lookup(&commit, repo, id)) < 0 || @@ -1111,12 +1126,18 @@ git_commit_summary(commit))) < 0) goto done; - if (ref) - error = git_reference_set_target( - &ref_new, ref, id, committer, git_buf_cstr(&reflog_msg)); + who = git_commit_committer(commit); + + if (ref) { + if ((error = ensure_is_an_updatable_direct_reference(ref)) < 0) + return error; + + error = reference__create(&ref_new, repo, ref->name, id, NULL, 1, who, + git_buf_cstr(&reflog_msg), &ref->target.oid, NULL); + } else error = git_reference__update_terminal( - repo, ref_name, id, committer, git_buf_cstr(&reflog_msg)); + repo, ref_name, id, who, git_buf_cstr(&reflog_msg)); done: git_reference_free(ref_new); @@ -1263,10 +1284,8 @@ return git_reference__is_valid_name(refname, GIT_REF_FORMAT_ALLOW_ONELEVEL); } -const char *git_reference_shorthand(const git_reference *ref) +const char *git_reference__shorthand(const char *name) { - const char *name = ref->name; - if (!git__prefixcmp(name, GIT_REFS_HEADS_DIR)) return name + strlen(GIT_REFS_HEADS_DIR); else if (!git__prefixcmp(name, GIT_REFS_TAGS_DIR)) @@ -1279,3 +1298,8 @@ /* No shorthands are avaiable, so just return the name */ return name; } + +const char *git_reference_shorthand(const git_reference *ref) +{ + return git_reference__shorthand(ref->name); +} diff -Nru libgit2-0.22.2/src/refs.h libgit2-0.23.1/src/refs.h --- libgit2-0.22.2/src/refs.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/refs.h 2015-08-03 18:07:35.000000000 +0000 @@ -69,11 +69,12 @@ git_reference *git_reference__set_name(git_reference *ref, const char *name); int git_reference__normalize_name(git_buf *buf, const char *name, unsigned int flags); -int git_reference__update_terminal(git_repository *repo, const char *ref_name, const git_oid *oid, const git_signature *signature, const char *log_message); +int git_reference__update_terminal(git_repository *repo, const char *ref_name, const git_oid *oid, const git_signature *sig, const char *log_message); int git_reference__is_valid_name(const char *refname, unsigned int flags); int git_reference__is_branch(const char *ref_name); int git_reference__is_remote(const char *ref_name); int git_reference__is_tag(const char *ref_name); +const char *git_reference__shorthand(const char *name); /** * Lookup a reference by name and try to resolve to an OID. @@ -106,7 +107,6 @@ git_reference *ref, const char *ref_name, const git_oid *id, - const git_signature *committer, const char *operation); #endif diff -Nru libgit2-0.22.2/src/refspec.c libgit2-0.23.1/src/refspec.c --- libgit2-0.22.2/src/refspec.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/refspec.c 2015-08-03 18:07:35.000000000 +0000 @@ -42,6 +42,12 @@ */ if (!is_fetch && rhs == lhs && rhs[1] == '\0') { refspec->matching = 1; + refspec->string = git__strdup(input); + GITERR_CHECK_ALLOC(refspec->string); + refspec->src = git__strdup(""); + GITERR_CHECK_ALLOC(refspec->src); + refspec->dst = git__strdup(""); + GITERR_CHECK_ALLOC(refspec->dst); return 0; } @@ -133,6 +139,10 @@ return 0; invalid: + giterr_set( + GITERR_INVALID, + "'%s' is not a valid refspec.", input); + git_refspec__free(refspec); return -1; } @@ -144,6 +154,8 @@ git__free(refspec->src); git__free(refspec->dst); git__free(refspec->string); + + memset(refspec, 0x0, sizeof(git_refspec)); } const char *git_refspec_src(const git_refspec *refspec) diff -Nru libgit2-0.22.2/src/remote.c libgit2-0.23.1/src/remote.c --- libgit2-0.22.2/src/remote.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/remote.c 2015-08-03 18:07:35.000000000 +0000 @@ -20,8 +20,15 @@ #include "fetchhead.h" #include "push.h" +#define CONFIG_URL_FMT "remote.%s.url" +#define CONFIG_PUSHURL_FMT "remote.%s.pushurl" +#define CONFIG_FETCH_FMT "remote.%s.fetch" +#define CONFIG_PUSH_FMT "remote.%s.push" +#define CONFIG_TAGOPT_FMT "remote.%s.tagopt" + static int dwim_refspecs(git_vector *out, git_vector *refspecs, git_vector *refs); static int lookup_remote_prune_config(git_remote *remote, git_config *config, const char *name); +char *apply_insteadof(git_config *config, const char *url, int direction); static int add_refspec_to(git_vector *vector, const char *string, bool is_fetch) { @@ -52,11 +59,10 @@ static int download_tags_value(git_remote *remote, git_config *cfg) { - const git_config_entry *ce; + git_config_entry *ce; git_buf buf = GIT_BUF_INIT; int error; - /* The 0 value is the default (auto), let's see if we need to change it */ if (git_buf_printf(&buf, "remote.%s.tagopt", remote->name) < 0) return -1; @@ -70,6 +76,7 @@ remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL; } + git_config_entry_free(ce); return error; } @@ -87,6 +94,48 @@ return error; } +static int write_add_refspec(git_repository *repo, const char *name, const char *refspec, bool fetch) +{ + git_config *cfg; + git_buf var = GIT_BUF_INIT; + git_refspec spec; + const char *fmt; + int error; + + if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) + return error; + + fmt = fetch ? CONFIG_FETCH_FMT : CONFIG_PUSH_FMT; + + if ((error = ensure_remote_name_is_valid(name)) < 0) + return error; + + if ((error = git_refspec__parse(&spec, refspec, fetch)) < 0) { + if (giterr_last()->klass != GITERR_NOMEMORY) + error = GIT_EINVALIDSPEC; + + return error; + } + + git_refspec__free(&spec); + + if ((error = git_buf_printf(&var, fmt, name)) < 0) + return error; + + /* + * "$^" is a unmatcheable regexp: it will not match anything at all, so + * all values will be considered new and we will not replace any + * present value. + */ + if ((error = git_config_set_multivar(cfg, var.ptr, "$^", refspec)) < 0) { + goto cleanup; + } + +cleanup: + git_buf_free(&var); + return 0; +} + #if 0 /* We could export this as a helper */ static int get_check_cert(int *out, git_repository *repo) @@ -118,14 +167,18 @@ static int canonicalize_url(git_buf *out, const char *in) { -#ifdef GIT_WIN32 - const char *c; + if (in == NULL || strlen(in) == 0) { + giterr_set(GITERR_INVALID, "cannot set empty URL"); + return GIT_EINVALIDSPEC; + } +#ifdef GIT_WIN32 /* Given a UNC path like \\server\path, we need to convert this * to //server/path for compatibility with core git. */ if (in[0] == '\\' && in[1] == '\\' && (git__isalpha(in[2]) || git__isdigit(in[2]))) { + const char *c; for (c = in; *c; c++) git_buf_putc(out, *c == '\\' ? '/' : *c); @@ -140,47 +193,65 @@ { git_remote *remote; git_config *config = NULL; - git_buf canonical_url = GIT_BUF_INIT, fetchbuf = GIT_BUF_INIT; + git_buf canonical_url = GIT_BUF_INIT; + git_buf var = GIT_BUF_INIT; int error = -1; /* name is optional */ assert(out && repo && url); + if ((error = git_repository_config__weakptr(&config, repo)) < 0) + return error; + remote = git__calloc(1, sizeof(git_remote)); GITERR_CHECK_ALLOC(remote); remote->repo = repo; - remote->update_fetchhead = 1; if (git_vector_init(&remote->refs, 32, NULL) < 0 || canonicalize_url(&canonical_url, url) < 0) goto on_error; - remote->url = git_buf_detach(&canonical_url); + remote->url = apply_insteadof(repo->_config, canonical_url.ptr, GIT_DIRECTION_FETCH); if (name != NULL) { remote->name = git__strdup(name); GITERR_CHECK_ALLOC(remote->name); + + if ((error = git_buf_printf(&var, CONFIG_URL_FMT, name)) < 0) + goto on_error; + + if ((error = git_config_set_string(config, var.ptr, canonical_url.ptr)) < 0) + goto on_error; } if (fetch != NULL) { - if (add_refspec(remote, fetch, true) < 0) + if ((error = add_refspec(remote, fetch, true)) < 0) + goto on_error; + + /* only write for non-anonymous remotes */ + if (name && (error = write_add_refspec(repo, name, fetch, true)) < 0) goto on_error; if ((error = git_repository_config_snapshot(&config, repo)) < 0) goto on_error; - if (lookup_remote_prune_config(remote, config, name) < 0) + if ((error = lookup_remote_prune_config(remote, config, name)) < 0) goto on_error; /* Move the data over to where the matching functions can find them */ - if (dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs) < 0) + if ((error = dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs)) < 0) goto on_error; } + /* A remote without a name doesn't download tags */ if (!name) - /* A remote without a name doesn't download tags */ remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_NONE; + else + remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO; + + + git_buf_free(&var); *out = remote; error = 0; @@ -190,8 +261,8 @@ git_remote_free(remote); git_config_free(config); - git_buf_free(&fetchbuf); git_buf_free(&canonical_url); + git_buf_free(&var); return error; } @@ -246,9 +317,6 @@ if (create_internal(&remote, repo, name, url, fetch) < 0) goto on_error; - if (git_remote_save(remote) < 0) - goto on_error; - *out = remote; return 0; @@ -258,22 +326,16 @@ return -1; } -int git_remote_create_anonymous(git_remote **out, git_repository *repo, const char *url, const char *fetch) +int git_remote_create_anonymous(git_remote **out, git_repository *repo, const char *url) { - int error; - git_remote *remote; - - if ((error = create_internal(&remote, repo, NULL, url, fetch)) < 0) - return error; - - *out = remote; - return 0; + return create_internal(out, repo, NULL, url, NULL); } int git_remote_dup(git_remote **dest, git_remote *source) { + size_t i; int error = 0; - git_strarray refspecs = { 0 }; + git_refspec *spec; git_remote *remote = git__calloc(1, sizeof(git_remote)); GITERR_CHECK_ALLOC(remote); @@ -284,7 +346,7 @@ if (source->url != NULL) { remote->url = git__strdup(source->url); - GITERR_CHECK_ALLOC(remote->url); + GITERR_CHECK_ALLOC(remote->url); } if (source->pushurl != NULL) { @@ -292,11 +354,8 @@ GITERR_CHECK_ALLOC(remote->pushurl); } - remote->transport_cb = source->transport_cb; - remote->transport_cb_payload = source->transport_cb_payload; remote->repo = source->repo; remote->download_tags = source->download_tags; - remote->update_fetchhead = source->update_fetchhead; remote->prune_refs = source->prune_refs; if (git_vector_init(&remote->refs, 32, NULL) < 0 || @@ -306,22 +365,15 @@ goto cleanup; } - if ((error = git_remote_get_fetch_refspecs(&refspecs, source)) < 0 || - (error = git_remote_set_fetch_refspecs(remote, &refspecs)) < 0) - goto cleanup; - - git_strarray_free(&refspecs); - - if ((error = git_remote_get_push_refspecs(&refspecs, source)) < 0 || - (error = git_remote_set_push_refspecs(remote, &refspecs)) < 0) - goto cleanup; + git_vector_foreach(&source->refspecs, i, spec) { + if ((error = add_refspec(remote, spec->string, !spec->push)) < 0) + goto cleanup; + } *dest = remote; cleanup: - git_strarray_free(&refspecs); - if (error < 0) git__free(remote); @@ -383,11 +435,9 @@ if ((error = git_repository_config_snapshot(&config, repo)) < 0) return error; - remote = git__malloc(sizeof(git_remote)); + remote = git__calloc(1, sizeof(git_remote)); GITERR_CHECK_ALLOC(remote); - memset(remote, 0x0, sizeof(git_remote)); - remote->update_fetchhead = 1; remote->name = git__strdup(name); GITERR_CHECK_ALLOC(remote->name); @@ -408,9 +458,10 @@ optional_setting_found |= found; remote->repo = repo; + remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO; if (found && strlen(val) > 0) { - remote->url = git__strdup(val); + remote->url = apply_insteadof(config, val, GIT_DIRECTION_FETCH); GITERR_CHECK_ALLOC(remote->url); } @@ -430,7 +481,7 @@ } if (found && strlen(val) > 0) { - remote->pushurl = git__strdup(val); + remote->pushurl = apply_insteadof(config, val, GIT_DIRECTION_PUSH); GITERR_CHECK_ALLOC(remote->pushurl); } @@ -457,7 +508,7 @@ goto cleanup; /* Move the data over to where the matching functions can find them */ - if (dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs) < 0) + if ((error = dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs)) < 0) goto cleanup; *out = remote; @@ -543,86 +594,6 @@ return error; } -int git_remote_save(const git_remote *remote) -{ - int error; - git_config *cfg; - const char *tagopt = NULL; - git_buf buf = GIT_BUF_INIT; - const git_config_entry *existing; - - assert(remote); - - if (!remote->name) { - giterr_set(GITERR_INVALID, "Can't save an anonymous remote."); - return GIT_EINVALIDSPEC; - } - - if ((error = ensure_remote_name_is_valid(remote->name)) < 0) - return error; - - if ((error = git_repository_config__weakptr(&cfg, remote->repo)) < 0) - return error; - - if ((error = git_buf_printf(&buf, "remote.%s.url", remote->name)) < 0) - return error; - - /* after this point, buffer is allocated so end with cleanup */ - - if ((error = git_config_set_string( - cfg, git_buf_cstr(&buf), remote->url)) < 0) - goto cleanup; - - git_buf_clear(&buf); - if ((error = git_buf_printf(&buf, "remote.%s.pushurl", remote->name)) < 0) - goto cleanup; - - if ((error = git_config__update_entry( - cfg, git_buf_cstr(&buf), remote->pushurl, true, false)) < 0) - goto cleanup; - - if ((error = update_config_refspec(remote, cfg, GIT_DIRECTION_FETCH)) < 0) - goto cleanup; - - if ((error = update_config_refspec(remote, cfg, GIT_DIRECTION_PUSH)) < 0) - goto cleanup; - - /* - * What action to take depends on the old and new values. This - * is describes by the table below. tagopt means whether the - * is already a value set in the config - * - * AUTO ALL or NONE - * +-----------------------+ - * tagopt | remove | set | - * +---------+-------------| - * !tagopt | nothing | set | - * +---------+-------------+ - */ - - git_buf_clear(&buf); - if ((error = git_buf_printf(&buf, "remote.%s.tagopt", remote->name)) < 0) - goto cleanup; - - if ((error = git_config__lookup_entry( - &existing, cfg, git_buf_cstr(&buf), false)) < 0) - goto cleanup; - - if (remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_ALL) - tagopt = "--tags"; - else if (remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_NONE) - tagopt = "--no-tags"; - else if (existing != NULL) - tagopt = NULL; - - error = git_config__update_entry( - cfg, git_buf_cstr(&buf), tagopt, true, false); - -cleanup: - git_buf_free(&buf); - return error; -} - const char *git_remote_name(const git_remote *remote) { assert(remote); @@ -641,16 +612,42 @@ return remote->url; } -int git_remote_set_url(git_remote *remote, const char* url) +static int set_url(git_repository *repo, const char *remote, const char *pattern, const char *url) { - assert(remote); - assert(url); + git_config *cfg; + git_buf buf = GIT_BUF_INIT, canonical_url = GIT_BUF_INIT; + int error; - git__free(remote->url); - remote->url = git__strdup(url); - GITERR_CHECK_ALLOC(remote->url); + assert(repo && remote); - return 0; + if ((error = ensure_remote_name_is_valid(remote)) < 0) + return error; + + if ((error = git_repository_config__weakptr(&cfg, repo)) < 0) + return error; + + if ((error = git_buf_printf(&buf, pattern, remote)) < 0) + return error; + + if (url) { + if ((error = canonicalize_url(&canonical_url, url)) < 0) + goto cleanup; + + error = git_config_set_string(cfg, buf.ptr, url); + } else { + error = git_config_delete_entry(cfg, buf.ptr); + } + +cleanup: + git_buf_free(&canonical_url); + git_buf_free(&buf); + + return error; +} + +int git_remote_set_url(git_repository *repo, const char *remote, const char *url) +{ + return set_url(repo, remote, CONFIG_URL_FMT, url); } const char *git_remote_pushurl(const git_remote *remote) @@ -659,18 +656,9 @@ return remote->pushurl; } -int git_remote_set_pushurl(git_remote *remote, const char* url) +int git_remote_set_pushurl(git_repository *repo, const char *remote, const char* url) { - assert(remote); - - git__free(remote->pushurl); - if (url) { - remote->pushurl = git__strdup(url); - GITERR_CHECK_ALLOC(remote->pushurl); - } else { - remote->pushurl = NULL; - } - return 0; + return set_url(repo, remote, CONFIG_PUSHURL_FMT, url); } const char* git_remote__urlfordirection(git_remote *remote, int direction) @@ -690,15 +678,34 @@ return NULL; } -int git_remote_connect(git_remote *remote, git_direction direction) +int set_transport_callbacks(git_transport *t, const git_remote_callbacks *cbs) +{ + if (!t->set_callbacks || !cbs) + return 0; + + return t->set_callbacks(t, cbs->sideband_progress, NULL, + cbs->certificate_check, cbs->payload); +} + +int git_remote_connect(git_remote *remote, git_direction direction, const git_remote_callbacks *callbacks) { git_transport *t; const char *url; int flags = GIT_TRANSPORTFLAGS_NONE; int error; + void *payload = NULL; + git_cred_acquire_cb credentials = NULL; + git_transport_cb transport = NULL; assert(remote); + if (callbacks) { + GITERR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); + credentials = callbacks->credentials; + transport = callbacks->transport; + payload = callbacks->payload; + } + t = remote->transport; url = git_remote__urlfordirection(remote, direction); @@ -710,8 +717,8 @@ /* If we don't have a transport object yet, and the caller specified a * custom transport factory, use that */ - if (!t && remote->transport_cb && - (error = remote->transport_cb(&t, remote, remote->transport_cb_payload)) < 0) + if (!t && transport && + (error = transport(&t, remote, payload)) < 0) return error; /* If we still don't have a transport, then use the global @@ -719,11 +726,8 @@ if (!t && (error = git_transport_new(&t, remote, url)) < 0) return error; - if (t->set_callbacks && - (error = t->set_callbacks(t, remote->callbacks.sideband_progress, NULL, remote->callbacks.certificate_check, remote->callbacks.payload)) < 0) - goto on_error; - - if ((error = t->connect(t, url, remote->callbacks.credentials, remote->callbacks.payload, direction, flags)) != 0) + if ((error = set_transport_callbacks(t, callbacks)) < 0 || + (error = t->connect(t, url, credentials, payload, direction, flags)) != 0) goto on_error; remote->transport = t; @@ -754,7 +758,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_url) { git_config *cfg; - const git_config_entry *ce; + git_config_entry *ce = NULL; const char *val = NULL; int error; @@ -806,6 +810,7 @@ *proxy_url = git__strdup(val); GITERR_CHECK_ALLOC(*proxy_url); } + git_config_entry_free(ce); return 0; } @@ -864,14 +869,24 @@ return 0; } -int git_remote_download(git_remote *remote, const git_strarray *refspecs) +int git_remote_download(git_remote *remote, const git_strarray *refspecs, const git_fetch_options *opts) { int error = -1; size_t i; - git_vector refs, specs, *to_active; + git_vector *to_active, specs = GIT_VECTOR_INIT, refs = GIT_VECTOR_INIT; + const git_remote_callbacks *cbs = NULL; assert(remote); + if (opts) { + GITERR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); + cbs = &opts->callbacks; + } + + if (!git_remote_connected(remote) && + (error = git_remote_connect(remote, GIT_DIRECTION_FETCH, cbs)) < 0) + goto on_error; + if (ls_to_vector(&refs, remote) < 0) return -1; @@ -910,10 +925,10 @@ remote->push = NULL; } - if ((error = git_fetch_negotiate(remote)) < 0) + if ((error = git_fetch_negotiate(remote, opts)) < 0) return error; - return git_fetch_download_pack(remote); + return git_fetch_download_pack(remote, cbs); on_error: git_vector_free(&refs); @@ -925,17 +940,27 @@ int git_remote_fetch( git_remote *remote, const git_strarray *refspecs, - const git_signature *signature, + const git_fetch_options *opts, const char *reflog_message) { - int error; + int error, update_fetchhead = 1; + git_remote_autotag_option_t tagopt = remote->download_tags; + bool prune = false; git_buf reflog_msg_buf = GIT_BUF_INIT; + const git_remote_callbacks *cbs = NULL; + + if (opts) { + GITERR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); + cbs = &opts->callbacks; + update_fetchhead = opts->update_fetchhead; + tagopt = opts->download_tags; + } /* Connect and download everything */ - if ((error = git_remote_connect(remote, GIT_DIRECTION_FETCH)) != 0) + if ((error = git_remote_connect(remote, GIT_DIRECTION_FETCH, cbs)) != 0) return error; - error = git_remote_download(remote, refspecs); + error = git_remote_download(remote, refspecs, opts); /* We don't need to be connected anymore */ git_remote_disconnect(remote); @@ -953,13 +978,22 @@ } /* Create "remote/foo" branches for all remote branches */ - error = git_remote_update_tips(remote, signature, git_buf_cstr(&reflog_msg_buf)); + error = git_remote_update_tips(remote, cbs, update_fetchhead, tagopt, git_buf_cstr(&reflog_msg_buf)); git_buf_free(&reflog_msg_buf); if (error < 0) return error; - if (remote->prune_refs) - error = git_remote_prune(remote); + if (opts && opts->prune == GIT_FETCH_PRUNE) + prune = true; + else if (opts && opts->prune == GIT_FETCH_PRUNE_UNSPECIFIED && remote->prune_refs) + prune = true; + else if (opts && opts->prune == GIT_FETCH_NO_PRUNE) + prune = false; + else + prune = remote->prune_refs; + + if (prune) + error = git_remote_prune(remote, cbs); return error; } @@ -1155,7 +1189,7 @@ return strcmp(a->name, b->name); } -int git_remote_prune(git_remote *remote) +int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks) { size_t i, j; git_vector remote_refs = GIT_VECTOR_INIT; @@ -1165,6 +1199,9 @@ int error; git_oid zero_id = {{ 0 }}; + if (callbacks) + GITERR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); + if ((error = ls_to_vector(&remote_refs, remote)) < 0) goto cleanup; @@ -1241,8 +1278,8 @@ if (error < 0) goto cleanup; - if (remote->callbacks.update_tips) - error = remote->callbacks.update_tips(refname, &id, &zero_id, remote->callbacks.payload); + if (callbacks && callbacks->update_tips) + error = callbacks->update_tips(refname, &id, &zero_id, callbacks->payload); if (error < 0) goto cleanup; @@ -1256,9 +1293,11 @@ static int update_tips_for_spec( git_remote *remote, + const git_remote_callbacks *callbacks, + int update_fetchhead, + git_remote_autotag_option_t tagopt, git_refspec *spec, git_vector *refs, - const git_signature *signature, const char *log_message) { int error = 0, autotag; @@ -1292,9 +1331,9 @@ continue; if (git_refspec_src_matches(&tagspec, head->name)) { - if (remote->download_tags != GIT_REMOTE_DOWNLOAD_TAGS_NONE) { + if (tagopt != GIT_REMOTE_DOWNLOAD_TAGS_NONE) { - if (remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_AUTO) + if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_AUTO) autotag = 1; git_buf_clear(&refname); @@ -1303,9 +1342,20 @@ } else { continue; } - } else if (git_refspec_src_matches(spec, head->name) && spec->dst) { - if (git_refspec_transform(&refname, spec, head->name) < 0) - goto on_error; + } else if (git_refspec_src_matches(spec, head->name)) { + if (spec->dst) { + if (git_refspec_transform(&refname, spec, head->name) < 0) + goto on_error; + } else { + /* + * no rhs mans store it in FETCH_HEAD, even if we don't + update anything else. + */ + if ((error = git_vector_insert(&update_heads, head)) < 0) + goto on_error; + + continue; + } } else { continue; } @@ -1333,19 +1383,19 @@ /* In autotag mode, don't overwrite any locally-existing tags */ error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, !autotag, - signature, log_message); + log_message); if (error < 0 && error != GIT_EEXISTS) goto on_error; git_reference_free(ref); - if (remote->callbacks.update_tips != NULL) { - if (remote->callbacks.update_tips(refname.ptr, &old, &head->oid, remote->callbacks.payload) < 0) + if (callbacks && callbacks->update_tips != NULL) { + if (callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload) < 0) goto on_error; } } - if (git_remote_update_fetchhead(remote) && + if (update_fetchhead && (error = git_remote_write_fetchhead(remote, spec, &update_heads)) < 0) goto on_error; @@ -1419,18 +1469,20 @@ return GIT_ITEROVER; } -static int opportunistic_updates(const git_remote *remote, git_vector *refs, const git_signature *sig, const char *msg) +static int opportunistic_updates(const git_remote *remote, const git_remote_callbacks *callbacks, + git_vector *refs, const char *msg) { size_t i, j, k; git_refspec *spec; git_remote_head *head; git_reference *ref; git_buf refname = GIT_BUF_INIT; - int error; + int error = 0; i = j = k = 0; while ((error = next_head(remote, refs, &spec, &head, &i, &j, &k)) == 0) { + git_oid old = {{ 0 }}; /* * If we got here, there is a refspec which was used * for fetching which matches the source of one of the @@ -1439,33 +1491,56 @@ * FETCH_HEAD */ + git_buf_clear(&refname); if ((error = git_refspec_transform(&refname, spec, head->name)) < 0) - return error; + goto cleanup; - error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, true, sig, msg); - git_buf_free(&refname); - git_reference_free(ref); + error = git_reference_name_to_id(&old, remote->repo, refname.ptr); + if (error < 0 && error != GIT_ENOTFOUND) + goto cleanup; + if (!git_oid_cmp(&old, &head->oid)) + continue; + + /* If we did find a current reference, make sure we haven't lost a race */ + if (error) + error = git_reference_create(&ref, remote->repo, refname.ptr, &head->oid, true, msg); + else + error = git_reference_create_matching(&ref, remote->repo, refname.ptr, &head->oid, true, &old, msg); + git_reference_free(ref); if (error < 0) - return error; + goto cleanup; + + if (callbacks && callbacks->update_tips != NULL) { + if (callbacks->update_tips(refname.ptr, &old, &head->oid, callbacks->payload) < 0) + goto cleanup; + } } - return 0; + if (error == GIT_ITEROVER) + error = 0; + +cleanup: + git_buf_free(&refname); + return error; } int git_remote_update_tips( git_remote *remote, - const git_signature *signature, + const git_remote_callbacks *callbacks, + int update_fetchhead, + git_remote_autotag_option_t download_tags, const char *reflog_message) { git_refspec *spec, tagspec; git_vector refs = GIT_VECTOR_INIT; + git_remote_autotag_option_t tagopt; int error; size_t i; /* push has its own logic hidden away in the push object */ if (remote->push) { - return git_push_update_tips(remote->push, signature, reflog_message); + return git_push_update_tips(remote->push, callbacks); } if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0) @@ -1475,8 +1550,13 @@ if ((error = ls_to_vector(&refs, remote)) < 0) goto out; - if (remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { - if ((error = update_tips_for_spec(remote, &tagspec, &refs, signature, reflog_message)) < 0) + if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED) + tagopt = remote->download_tags; + else + tagopt = download_tags; + + if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { + if ((error = update_tips_for_spec(remote, callbacks, update_fetchhead, tagopt, &tagspec, &refs, reflog_message)) < 0) goto out; } @@ -1484,13 +1564,13 @@ if (spec->push) continue; - if ((error = update_tips_for_spec(remote, spec, &refs, signature, reflog_message)) < 0) + if ((error = update_tips_for_spec(remote, callbacks, update_fetchhead, tagopt, spec, &refs, reflog_message)) < 0) goto out; } /* only try to do opportunisitic updates if the refpec lists differ */ if (remote->passed_refspecs) - error = opportunistic_updates(remote, &refs, signature, reflog_message); + error = opportunistic_updates(remote, callbacks, &refs, reflog_message); out: git_vector_free(&refs); @@ -1601,48 +1681,6 @@ return 0; } -int git_remote_set_callbacks(git_remote *remote, const git_remote_callbacks *callbacks) -{ - assert(remote && callbacks); - - GITERR_CHECK_VERSION(callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); - - memcpy(&remote->callbacks, callbacks, sizeof(git_remote_callbacks)); - - if (remote->transport && remote->transport->set_callbacks) - return remote->transport->set_callbacks(remote->transport, - remote->callbacks.sideband_progress, - NULL, - remote->callbacks.certificate_check, - remote->callbacks.payload); - - return 0; -} - -const git_remote_callbacks *git_remote_get_callbacks(git_remote *remote) -{ - assert(remote); - - return &remote->callbacks; -} - -int git_remote_set_transport( - git_remote *remote, - git_transport_cb transport_cb, - void *payload) -{ - assert(remote); - - if (remote->transport) { - giterr_set(GITERR_NET, "A transport is already bound to this remote"); - return -1; - } - - remote->transport_cb = transport_cb; - remote->transport_cb_payload = payload; - return 0; -} - const git_transfer_progress* git_remote_stats(git_remote *remote) { assert(remote); @@ -1654,9 +1692,42 @@ return remote->download_tags; } -void git_remote_set_autotag(git_remote *remote, git_remote_autotag_option_t value) +int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_autotag_option_t value) { - remote->download_tags = value; + git_buf var = GIT_BUF_INIT; + git_config *config; + int error; + + assert(repo && remote); + + if ((error = ensure_remote_name_is_valid(remote)) < 0) + return error; + + if ((error = git_repository_config__weakptr(&config, repo)) < 0) + return error; + + if ((error = git_buf_printf(&var, CONFIG_TAGOPT_FMT, remote))) + return error; + + switch (value) { + case GIT_REMOTE_DOWNLOAD_TAGS_NONE: + error = git_config_set_string(config, var.ptr, "--no-tags"); + break; + case GIT_REMOTE_DOWNLOAD_TAGS_ALL: + error = git_config_set_string(config, var.ptr, "--tags"); + break; + case GIT_REMOTE_DOWNLOAD_TAGS_AUTO: + error = git_config_delete_entry(config, var.ptr); + if (error == GIT_ENOTFOUND) + error = 0; + break; + default: + giterr_set(GITERR_INVALID, "Invalid value for the tagopt setting"); + error = -1; + } + + git_buf_free(&var); + return error; } int git_remote_prune_refs(const git_remote *remote) @@ -1756,7 +1827,7 @@ goto cleanup; if ((error = git_reference_rename(&ref, reference_in, git_buf_cstr(&new_name), 1, - NULL, git_buf_cstr(&log_message))) < 0) + git_buf_cstr(&log_message))) < 0) goto cleanup; if (git_reference_type(ref) != GIT_REF_SYMBOLIC) @@ -1776,7 +1847,7 @@ goto cleanup; error = git_reference_symbolic_set_target(&dummy, ref, git_buf_cstr(&new_name), - NULL, git_buf_cstr(&log_message)); + git_buf_cstr(&log_message)); git_reference_free(dummy); @@ -1927,16 +1998,6 @@ return error; } -int git_remote_update_fetchhead(git_remote *remote) -{ - return (remote->update_fetchhead != 0); -} - -void git_remote_set_update_fetchhead(git_remote *remote, int value) -{ - remote->update_fetchhead = (value != 0); -} - int git_remote_is_valid_name( const char *remote_name) { @@ -1989,26 +2050,14 @@ return NULL; } -void git_remote_clear_refspecs(git_remote *remote) -{ - git_refspec *spec; - size_t i; - - git_vector_foreach(&remote->refspecs, i, spec) { - git_refspec__free(spec); - git__free(spec); - } - git_vector_clear(&remote->refspecs); -} - -int git_remote_add_fetch(git_remote *remote, const char *refspec) +int git_remote_add_fetch(git_repository *repo, const char *remote, const char *refspec) { - return add_refspec(remote, refspec, true); + return write_add_refspec(repo, remote, refspec, true); } -int git_remote_add_push(git_remote *remote, const char *refspec) +int git_remote_add_push(git_repository *repo, const char *remote, const char *refspec) { - return add_refspec(remote, refspec, false); + return write_add_refspec(repo, remote, refspec, false); } static int set_refspecs(git_remote *remote, git_strarray *array, int push) @@ -2039,16 +2088,6 @@ return 0; } -int git_remote_set_fetch_refspecs(git_remote *remote, git_strarray *array) -{ - return set_refspecs(remote, array, false); -} - -int git_remote_set_push_refspecs(git_remote *remote, git_strarray *array) -{ - return set_refspecs(remote, array, true); -} - static int copy_refspecs(git_strarray *array, const git_remote *remote, unsigned int push) { size_t i; @@ -2322,16 +2361,19 @@ int error; git_push *push; git_refspec *spec; - git_remote_callbacks *cbs; + const git_remote_callbacks *cbs = NULL; assert(remote); + if (opts) + cbs = &opts->callbacks; + if (!git_remote_connected(remote) && - (error = git_remote_connect(remote, GIT_DIRECTION_PUSH)) < 0) + (error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs)) < 0) goto cleanup; free_refspecs(&remote->active_refspecs); - if (dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs) < 0) + if ((error = dwim_refspecs(&remote->active_refspecs, &remote->refspecs, &remote->refs)) < 0) goto cleanup; if (remote->push) { @@ -2361,16 +2403,10 @@ } } - cbs = &remote->callbacks; - if ((error = git_push_set_callbacks(push, - cbs->pack_progress, cbs->payload, - cbs->push_transfer_progress, cbs->payload)) < 0) + if ((error = git_push_finish(push, cbs)) < 0) goto cleanup; - if ((error = git_push_finish(push)) < 0) - goto cleanup; - - if (cbs->push_update_reference && + if (cbs && cbs->push_update_reference && (error = git_push_status_foreach(push, cbs->push_update_reference, cbs->payload)) < 0) goto cleanup; @@ -2378,21 +2414,91 @@ return error; } -int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts, - const git_signature *signature, const char *reflog_message) +int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts) { int error; + const git_remote_callbacks *cbs = NULL; + + if (opts) { + GITERR_CHECK_VERSION(&opts->callbacks, GIT_REMOTE_CALLBACKS_VERSION, "git_remote_callbacks"); + cbs = &opts->callbacks; + } assert(remote && refspecs); - if ((error = git_remote_connect(remote, GIT_DIRECTION_PUSH)) < 0) + if ((error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs)) < 0) return error; if ((error = git_remote_upload(remote, refspecs, opts)) < 0) return error; - error = git_remote_update_tips(remote, signature, reflog_message); + error = git_remote_update_tips(remote, cbs, 0, 0, NULL); git_remote_disconnect(remote); return error; } + +#define PREFIX "url" +#define SUFFIX_FETCH "insteadof" +#define SUFFIX_PUSH "pushinsteadof" + +char *apply_insteadof(git_config *config, const char *url, int direction) +{ + size_t match_length, prefix_length, suffix_length; + char *replacement = NULL; + const char *regexp; + + git_buf result = GIT_BUF_INIT; + git_config_entry *entry; + git_config_iterator *iter; + + assert(config); + assert(url); + assert(direction == GIT_DIRECTION_FETCH || direction == GIT_DIRECTION_PUSH); + + /* Add 1 to prefix/suffix length due to the additional escaped dot */ + prefix_length = strlen(PREFIX) + 1; + if (direction == GIT_DIRECTION_FETCH) { + regexp = PREFIX "\\..*\\." SUFFIX_FETCH; + suffix_length = strlen(SUFFIX_FETCH) + 1; + } else { + regexp = PREFIX "\\..*\\." SUFFIX_PUSH; + suffix_length = strlen(SUFFIX_PUSH) + 1; + } + + if (git_config_iterator_glob_new(&iter, config, regexp) < 0) + return NULL; + + match_length = 0; + while (git_config_next(&entry, iter) == 0) { + size_t n, replacement_length; + + /* Check if entry value is a prefix of URL */ + if (git__prefixcmp(url, entry->value)) + continue; + /* Check if entry value is longer than previous + * prefixes */ + if ((n = strlen(entry->value)) <= match_length) + continue; + + git__free(replacement); + match_length = n; + + /* Cut off prefix and suffix of the value */ + replacement_length = + strlen(entry->name) - (prefix_length + suffix_length); + replacement = git__strndup(entry->name + prefix_length, + replacement_length); + } + + git_config_iterator_free(iter); + + if (match_length == 0) + return git__strdup(url); + + git_buf_printf(&result, "%s%s", replacement, url + match_length); + + git__free(replacement); + + return result.ptr; +} diff -Nru libgit2-0.22.2/src/remote.h libgit2-0.23.1/src/remote.h --- libgit2-0.22.2/src/remote.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/remote.h 2015-08-03 18:07:35.000000000 +0000 @@ -24,16 +24,12 @@ git_vector refspecs; git_vector active_refspecs; git_vector passive_refspecs; - git_transport_cb transport_cb; - void *transport_cb_payload; git_transport *transport; git_repository *repo; git_push *push; - git_remote_callbacks callbacks; git_transfer_progress stats; unsigned int need_pack; git_remote_autotag_option_t download_tags; - int update_fetchhead; int prune_refs; int passed_refspecs; }; diff -Nru libgit2-0.22.2/src/repository.c libgit2-0.23.1/src/repository.c --- libgit2-0.22.2/src/repository.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/repository.c 2015-08-03 18:07:35.000000000 +0000 @@ -26,19 +26,30 @@ #include "remote.h" #include "merge.h" #include "diff_driver.h" +#include "annotated_commit.h" #ifdef GIT_WIN32 # include "win32/w32_util.h" #endif +static int check_repositoryformatversion(git_config *config); + #define GIT_FILE_CONTENT_PREFIX "gitdir:" #define GIT_BRANCH_MASTER "master" #define GIT_REPO_VERSION 0 -const char *git_repository__8dot3_default = "GIT~1"; -size_t git_repository__8dot3_default_len = 5; +git_buf git_repository__reserved_names_win32[] = { + { DOT_GIT, 0, CONST_STRLEN(DOT_GIT) }, + { GIT_DIR_SHORTNAME, 0, CONST_STRLEN(GIT_DIR_SHORTNAME) } +}; +size_t git_repository__reserved_names_win32_len = 2; + +git_buf git_repository__reserved_names_posix[] = { + { DOT_GIT, 0, CONST_STRLEN(DOT_GIT) }, +}; +size_t git_repository__reserved_names_posix_len = 1; static void set_odb(git_repository *repo, git_odb *odb) { @@ -100,7 +111,6 @@ git_cache_clear(&repo->objects); git_attr_cache_flush(repo); - git_submodule_cache_free(repo); set_config(repo, NULL); set_index(repo, NULL); @@ -110,6 +120,8 @@ void git_repository_free(git_repository *repo) { + size_t i; + if (repo == NULL) return; @@ -120,10 +132,16 @@ git_diff_driver_registry_free(repo->diff_drivers); repo->diff_drivers = NULL; + for (i = 0; i < repo->reserved_names.size; i++) + git_buf_free(git_array_get(repo->reserved_names, i)); + git_array_clear(repo->reserved_names); + + git__free(repo->path_gitlink); git__free(repo->path_repository); git__free(repo->workdir); git__free(repo->namespace); - git__free(repo->name_8dot3); + git__free(repo->ident_name); + git__free(repo->ident_email); git__memzero(repo, sizeof(*repo)); git__free(repo); @@ -153,23 +171,37 @@ static git_repository *repository_alloc(void) { git_repository *repo = git__calloc(1, sizeof(git_repository)); - if (!repo) - return NULL; - if (git_cache_init(&repo->objects) < 0) { - git__free(repo); - return NULL; - } + if (repo == NULL || + git_cache_init(&repo->objects) < 0) + goto on_error; + + git_array_init_to_size(repo->reserved_names, 4); + if (!repo->reserved_names.ptr) + goto on_error; /* set all the entries in the cvar cache to `unset` */ git_repository__cvar_cache_clear(repo); return repo; + +on_error: + if (repo) + git_cache_free(&repo->objects); + + git__free(repo); + return NULL; } int git_repository_new(git_repository **out) { - *out = repository_alloc(); + git_repository *repo; + + *out = repo = repository_alloc(); + GITERR_CHECK_ALLOC(repo); + + repo->is_bare = 1; + return 0; } @@ -189,7 +221,7 @@ static int load_workdir(git_repository *repo, git_config *config, git_buf *parent_path) { int error; - const git_config_entry *ce; + git_config_entry *ce; git_buf worktree = GIT_BUF_INIT; if (repo->is_bare) @@ -202,7 +234,7 @@ if (ce && ce->value) { if ((error = git_path_prettify_dir( &worktree, ce->value, repo->path_repository)) < 0) - return error; + goto cleanup; repo->workdir = git_buf_detach(&worktree); } @@ -210,14 +242,18 @@ repo->workdir = git_buf_detach(parent_path); else { if (git_path_dirname_r(&worktree, repo->path_repository) < 0 || - git_path_to_dir(&worktree) < 0) - return -1; + git_path_to_dir(&worktree) < 0) { + error = -1; + goto cleanup; + } repo->workdir = git_buf_detach(&worktree); } GITERR_CHECK_ALLOC(repo->workdir); - return 0; +cleanup: + git_config_entry_free(ce); + return error; } /* @@ -314,6 +350,7 @@ static int find_repo( git_buf *repo_path, git_buf *parent_path, + git_buf *link_path, const char *start_path, uint32_t flags, const char *ceiling_dirs) @@ -356,9 +393,14 @@ git_buf repo_link = GIT_BUF_INIT; if (!(error = read_gitfile(&repo_link, path.ptr))) { - if (valid_repository_path(&repo_link)) + if (valid_repository_path(&repo_link)) { git_buf_swap(repo_path, &repo_link); + if (link_path) + error = git_buf_put(link_path, + path.ptr, path.size); + } + git_buf_free(&repo_link); break; } @@ -445,13 +487,17 @@ const char *ceiling_dirs) { int error; - git_buf path = GIT_BUF_INIT, parent = GIT_BUF_INIT; + git_buf path = GIT_BUF_INIT, parent = GIT_BUF_INIT, + link_path = GIT_BUF_INIT; git_repository *repo; + git_config *config = NULL; if (repo_ptr) *repo_ptr = NULL; - error = find_repo(&path, &parent, start_path, flags, ceiling_dirs); + error = find_repo( + &path, &parent, &link_path, start_path, flags, ceiling_dirs); + if (error < 0 || !repo_ptr) return error; @@ -461,22 +507,41 @@ repo->path_repository = git_buf_detach(&path); GITERR_CHECK_ALLOC(repo->path_repository); + if (link_path.size) { + repo->path_gitlink = git_buf_detach(&link_path); + GITERR_CHECK_ALLOC(repo->path_gitlink); + } + + /* + * We'd like to have the config, but git doesn't particularly + * care if it's not there, so we need to deal with that. + */ + + error = git_repository_config_snapshot(&config, repo); + if (error < 0 && error != GIT_ENOTFOUND) + goto cleanup; + + if (config && (error = check_repositoryformatversion(config)) < 0) + goto cleanup; + if ((flags & GIT_REPOSITORY_OPEN_BARE) != 0) repo->is_bare = 1; else { - git_config *config = NULL; - - if ((error = git_repository_config_snapshot(&config, repo)) < 0 || - (error = load_config_data(repo, config)) < 0 || - (error = load_workdir(repo, config, &parent)) < 0) - git_repository_free(repo); - git_config_free(config); + if (config && + ((error = load_config_data(repo, config)) < 0 || + (error = load_workdir(repo, config, &parent)) < 0)) + goto cleanup; } - if (!error) - *repo_ptr = repo; +cleanup: git_buf_free(&parent); + git_config_free(config); + + if (error < 0) + git_repository_free(repo); + else + *repo_ptr = repo; return error; } @@ -512,7 +577,7 @@ git_buf_sanitize(out); - return find_repo(out, NULL, start_path, flags, ceiling_dirs); + return find_repo(out, NULL, NULL, start_path, flags, ceiling_dirs); } static int load_config( @@ -776,7 +841,7 @@ void git_repository_set_index(git_repository *repo, git_index *index) { - assert(repo && index); + assert(repo); set_index(repo, index); } @@ -797,33 +862,102 @@ return repo->namespace; } -const char *git_repository__8dot3_name(git_repository *repo) +#ifdef GIT_WIN32 +static int reserved_names_add8dot3(git_repository *repo, const char *path) { - if (!repo->has_8dot3) { - repo->has_8dot3 = 1; + char *name = git_win32_path_8dot3_name(path); + const char *def = GIT_DIR_SHORTNAME; + const char *def_dot_git = DOT_GIT; + size_t name_len, def_len = CONST_STRLEN(GIT_DIR_SHORTNAME); + size_t def_dot_git_len = CONST_STRLEN(DOT_GIT); + git_buf *buf; -#ifdef GIT_WIN32 + if (!name) + return 0; + + name_len = strlen(name); + + if ((name_len == def_len && memcmp(name, def, def_len) == 0) || + (name_len == def_dot_git_len && memcmp(name, def_dot_git, def_dot_git_len) == 0)) { + git__free(name); + return 0; + } + + if ((buf = git_array_alloc(repo->reserved_names)) == NULL) + return -1; + + git_buf_attach(buf, name, name_len); + return true; +} + +bool git_repository__reserved_names( + git_buf **out, size_t *outlen, git_repository *repo, bool include_ntfs) +{ + GIT_UNUSED(include_ntfs); + + if (repo->reserved_names.size == 0) { + git_buf *buf; + size_t i; + + /* Add the static defaults */ + for (i = 0; i < git_repository__reserved_names_win32_len; i++) { + if ((buf = git_array_alloc(repo->reserved_names)) == NULL) + goto on_error; + + buf->ptr = git_repository__reserved_names_win32[i].ptr; + buf->size = git_repository__reserved_names_win32[i].size; + } + + /* Try to add any repo-specific reserved names */ if (!repo->is_bare) { - repo->name_8dot3 = git_win32_path_8dot3_name(repo->path_repository); + const char *reserved_path = repo->path_gitlink ? + repo->path_gitlink : repo->path_repository; - /* We anticipate the 8.3 name is "GIT~1", so use a static for - * easy testing in the common case */ - if (repo->name_8dot3 && - strcasecmp(repo->name_8dot3, git_repository__8dot3_default) == 0) - repo->has_8dot3_default = 1; + if (reserved_names_add8dot3(repo, reserved_path) < 0) + goto on_error; } -#endif } - return repo->has_8dot3_default ? - git_repository__8dot3_default : repo->name_8dot3; + *out = repo->reserved_names.ptr; + *outlen = repo->reserved_names.size; + + return true; + + /* Always give good defaults, even on OOM */ +on_error: + *out = git_repository__reserved_names_win32; + *outlen = git_repository__reserved_names_win32_len; + + return false; } +#else +bool git_repository__reserved_names( + git_buf **out, size_t *outlen, git_repository *repo, bool include_ntfs) +{ + GIT_UNUSED(repo); + + if (include_ntfs) { + *out = git_repository__reserved_names_win32; + *outlen = git_repository__reserved_names_win32_len; + } else { + *out = git_repository__reserved_names_posix; + *outlen = git_repository__reserved_names_posix_len; + } + + return true; +} +#endif static int check_repositoryformatversion(git_config *config) { - int version; + int version, error; - if (git_config_get_int32(&version, config, "core.repositoryformatversion") < 0) + error = git_config_get_int32(&version, config, "core.repositoryformatversion"); + /* git ignores this if the config variable isn't there */ + if (error == GIT_ENOTFOUND) + return 0; + + if (error < 0) return -1; if (GIT_REPO_VERSION < version) { @@ -1265,7 +1399,8 @@ if (opts->template_path) tdir = opts->template_path; else if ((error = git_config_open_default(&cfg)) >= 0) { - error = git_config_get_string(&tdir, cfg, "init.templatedir"); + if (!git_config_get_path(&template_buf, cfg, "init.templatedir")) + tdir = template_buf.ptr; giterr_clear(); } @@ -1497,6 +1632,7 @@ { int error; git_buf repo_path = GIT_BUF_INIT, wd_path = GIT_BUF_INIT; + const char *wd; assert(out && given_repo && opts); @@ -1506,6 +1642,7 @@ if (error < 0) goto cleanup; + wd = (opts->flags & GIT_REPOSITORY_INIT_BARE) ? NULL : git_buf_cstr(&wd_path); if (valid_repository_path(&repo_path)) { if ((opts->flags & GIT_REPOSITORY_INIT_NO_REINIT) != 0) { @@ -1518,15 +1655,15 @@ opts->flags |= GIT_REPOSITORY_INIT__IS_REINIT; error = repo_init_config( - repo_path.ptr, wd_path.ptr, opts->flags, opts->mode); + repo_path.ptr, wd, opts->flags, opts->mode); /* TODO: reinitialize the templates */ } else { if (!(error = repo_init_structure( - repo_path.ptr, wd_path.ptr, opts)) && + repo_path.ptr, wd, opts)) && !(error = repo_init_config( - repo_path.ptr, wd_path.ptr, opts->flags, opts->mode))) + repo_path.ptr, wd, opts->flags, opts->mode))) error = repo_init_create_head( repo_path.ptr, opts->initial_head); } @@ -1837,7 +1974,7 @@ */ error = git_path_join_unrooted( - &full_path, path, repo ? git_repository_workdir(repo) : NULL, NULL); + &full_path, path, git_repository_workdir(repo), NULL); if (error < 0) return error; @@ -1848,7 +1985,7 @@ if (strlen(as_path) > 0) { error = git_filter_list_load( &fl, repo, NULL, as_path, - GIT_FILTER_TO_ODB, GIT_FILTER_OPT_DEFAULT); + GIT_FILTER_TO_ODB, GIT_FILTER_DEFAULT); if (error < 0) return error; } else { @@ -1886,98 +2023,149 @@ return error; } -static bool looks_like_a_branch(const char *refname) +static int checkout_message(git_buf *out, git_reference *old, const char *new) { - return git__prefixcmp(refname, GIT_REFS_HEADS_DIR) == 0; + git_buf_puts(out, "checkout: moving from "); + + if (git_reference_type(old) == GIT_REF_SYMBOLIC) + git_buf_puts(out, git_reference__shorthand(git_reference_symbolic_target(old))); + else + git_buf_puts(out, git_oid_tostr_s(git_reference_target(old))); + + git_buf_puts(out, " to "); + + if (git_reference__is_branch(new)) + git_buf_puts(out, git_reference__shorthand(new)); + else + git_buf_puts(out, new); + + if (git_buf_oom(out)) + return -1; + + return 0; } int git_repository_set_head( git_repository* repo, - const char* refname, - const git_signature *signature, - const char *log_message) + const char* refname) { - git_reference *ref, - *new_head = NULL; + git_reference *ref = NULL, *current = NULL, *new_head = NULL; + git_buf log_message = GIT_BUF_INIT; int error; assert(repo && refname); + if ((error = git_reference_lookup(¤t, repo, GIT_HEAD_FILE)) < 0) + return error; + + if ((error = checkout_message(&log_message, current, refname)) < 0) + goto cleanup; + error = git_reference_lookup(&ref, repo, refname); if (error < 0 && error != GIT_ENOTFOUND) - return error; + goto cleanup; if (!error) { if (git_reference_is_branch(ref)) { error = git_reference_symbolic_create(&new_head, repo, GIT_HEAD_FILE, - git_reference_name(ref), true, signature, log_message); + git_reference_name(ref), true, git_buf_cstr(&log_message)); } else { - error = git_repository_set_head_detached(repo, git_reference_target(ref), - signature, log_message); + error = git_repository_set_head_detached(repo, git_reference_target(ref)); } - } else if (looks_like_a_branch(refname)) { + } else if (git_reference__is_branch(refname)) { error = git_reference_symbolic_create(&new_head, repo, GIT_HEAD_FILE, refname, - true, signature, log_message); + true, git_buf_cstr(&log_message)); } +cleanup: + git_buf_free(&log_message); + git_reference_free(current); git_reference_free(ref); git_reference_free(new_head); return error; } -int git_repository_set_head_detached( - git_repository* repo, - const git_oid* commitish, - const git_signature *signature, - const char *log_message) +static int detach(git_repository *repo, const git_oid *id, const char *from) { int error; - git_object *object, - *peeled = NULL; - git_reference *new_head = NULL; + git_buf log_message = GIT_BUF_INIT; + git_object *object = NULL, *peeled = NULL; + git_reference *new_head = NULL, *current = NULL; - assert(repo && commitish); + assert(repo && id); - if ((error = git_object_lookup(&object, repo, commitish, GIT_OBJ_ANY)) < 0) + if ((error = git_reference_lookup(¤t, repo, GIT_HEAD_FILE)) < 0) return error; + if ((error = git_object_lookup(&object, repo, id, GIT_OBJ_ANY)) < 0) + goto cleanup; + if ((error = git_object_peel(&peeled, object, GIT_OBJ_COMMIT)) < 0) goto cleanup; - error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), true, signature, log_message); + if (from == NULL) + from = git_oid_tostr_s(git_object_id(peeled)); + + if ((error = checkout_message(&log_message, current, from)) < 0) + goto cleanup; + + error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), true, git_buf_cstr(&log_message)); cleanup: + git_buf_free(&log_message); git_object_free(object); git_object_free(peeled); + git_reference_free(current); git_reference_free(new_head); return error; } -int git_repository_detach_head( +int git_repository_set_head_detached( git_repository* repo, - const git_signature *signature, - const char *reflog_message) + const git_oid* commitish) +{ + return detach(repo, commitish, NULL); +} + +int git_repository_set_head_detached_from_annotated( + git_repository *repo, + const git_annotated_commit *commitish) { - git_reference *old_head = NULL, - *new_head = NULL; + assert(repo && commitish); + + return detach(repo, git_annotated_commit_id(commitish), commitish->ref_name); +} + +int git_repository_detach_head(git_repository* repo) +{ + git_reference *old_head = NULL, *new_head = NULL, *current = NULL; git_object *object = NULL; + git_buf log_message = GIT_BUF_INIT; int error; assert(repo); - if ((error = git_repository_head(&old_head, repo)) < 0) + if ((error = git_reference_lookup(¤t, repo, GIT_HEAD_FILE)) < 0) return error; + if ((error = git_repository_head(&old_head, repo)) < 0) + goto cleanup; + if ((error = git_object_lookup(&object, repo, git_reference_target(old_head), GIT_OBJ_COMMIT)) < 0) goto cleanup; + if ((error = checkout_message(&log_message, current, git_oid_tostr_s(git_object_id(object)))) < 0) + goto cleanup; + error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_reference_target(old_head), - 1, signature, reflog_message); + 1, git_buf_cstr(&log_message)); cleanup: + git_buf_free(&log_message); git_object_free(object); git_reference_free(old_head); git_reference_free(new_head); + git_reference_free(current); return error; } @@ -2095,3 +2283,34 @@ GIT_REPOSITORY_INIT_OPTIONS_INIT); return 0; } + +int git_repository_ident(const char **name, const char **email, const git_repository *repo) +{ + *name = repo->ident_name; + *email = repo->ident_email; + + return 0; +} + +int git_repository_set_ident(git_repository *repo, const char *name, const char *email) +{ + char *tmp_name = NULL, *tmp_email = NULL; + + if (name) { + tmp_name = git__strdup(name); + GITERR_CHECK_ALLOC(tmp_name); + } + + if (email) { + tmp_email = git__strdup(email); + GITERR_CHECK_ALLOC(tmp_email); + } + + tmp_name = git__swap(repo->ident_name, tmp_name); + tmp_email = git__swap(repo->ident_email, tmp_email); + + git__free(tmp_name); + git__free(tmp_email); + + return 0; +} diff -Nru libgit2-0.22.2/src/repository.h libgit2-0.23.1/src/repository.h --- libgit2-0.22.2/src/repository.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/repository.h 2015-08-03 18:07:35.000000000 +0000 @@ -14,6 +14,7 @@ #include "git2/object.h" #include "git2/config.h" +#include "array.h" #include "cache.h" #include "refs.h" #include "buffer.h" @@ -27,6 +28,9 @@ #define GIT_DIR_MODE 0755 #define GIT_BARE_DIR_MODE 0777 +/* Default DOS-compatible 8.3 "short name" for a git repository, "GIT~1" */ +#define GIT_DIR_SHORTNAME "GIT~1" + /** Cvar cache identifiers */ typedef enum { GIT_CVAR_AUTO_CRLF = 0, /* core.autocrlf */ @@ -117,22 +121,27 @@ git_refdb *_refdb; git_config *_config; git_index *_index; - git_submodule_cache *_submodules; git_cache objects; git_attr_cache *attrcache; git_diff_driver_registry *diff_drivers; char *path_repository; + char *path_gitlink; char *workdir; char *namespace; - char *name_8dot3; - unsigned is_bare:1, - has_8dot3:1, - has_8dot3_default:1; + char *ident_name; + char *ident_email; + + git_array_t(git_buf) reserved_names; + + unsigned is_bare:1; + unsigned int lru_counter; + git_atomic attr_session_key; + git_cvar_value cvar_cache[GIT_CVAR_CACHE_MAX]; }; @@ -183,19 +192,24 @@ int git_repository__cleanup_files(git_repository *repo, const char *files[], size_t files_len); -/* - * Gets the DOS-compatible 8.3 "short name". This will return only the - * short name for the repository directory (ie, "git~1" for ".git"). This - * will always return a pointer to `git_repository__8dot3_default` when - * "GIT~1" is the short name. This will return NULL for bare repositories, - * and systems that do not have a short name. - */ -const char *git_repository__8dot3_name(git_repository *repo); +/* The default "reserved names" for a repository */ +extern git_buf git_repository__reserved_names_win32[]; +extern size_t git_repository__reserved_names_win32_len; -/* The default DOS-compatible 8.3 "short name" for a git repository, - * "GIT~1". +extern git_buf git_repository__reserved_names_posix[]; +extern size_t git_repository__reserved_names_posix_len; + +/* + * Gets any "reserved names" in the repository. This will return paths + * that should not be allowed in the repository (like ".git") to avoid + * conflicting with the repository path, or with alternate mechanisms to + * the repository path (eg, "GIT~1"). Every attempt will be made to look + * up all possible reserved names - if there was a conflict for the shortname + * GIT~1, for example, this function will try to look up the alternate + * shortname. If that fails, this function returns false, but out and outlen + * will still be populated with good defaults. */ -extern const char *git_repository__8dot3_default; -extern size_t git_repository__8dot3_default_len; +bool git_repository__reserved_names( + git_buf **out, size_t *outlen, git_repository *repo, bool include_ntfs); #endif diff -Nru libgit2-0.22.2/src/reset.c libgit2-0.23.1/src/reset.c --- libgit2-0.22.2/src/reset.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/reset.c 2015-08-03 18:07:35.000000000 +0000 @@ -10,6 +10,7 @@ #include "tag.h" #include "merge.h" #include "diff.h" +#include "annotated_commit.h" #include "git2/reset.h" #include "git2/checkout.h" #include "git2/merge.h" @@ -62,6 +63,7 @@ assert(delta->status == GIT_DELTA_ADDED || delta->status == GIT_DELTA_MODIFIED || + delta->status == GIT_DELTA_CONFLICTED || delta->status == GIT_DELTA_DELETED); error = git_index_conflict_remove(index, delta->old_file.path); @@ -96,20 +98,19 @@ return error; } -int git_reset( +static int reset( git_repository *repo, git_object *target, + const char *to, git_reset_t reset_type, - git_checkout_options *checkout_opts, - const git_signature *signature, - const char *log_message) + const git_checkout_options *checkout_opts) { git_object *commit = NULL; git_index *index = NULL; git_tree *tree = NULL; int error = 0; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - git_buf log_message_buf = GIT_BUF_INIT; + git_buf log_message = GIT_BUF_INIT; assert(repo && target); @@ -141,19 +142,17 @@ goto cleanup; } - if (log_message) - git_buf_sets(&log_message_buf, log_message); - else - git_buf_sets(&log_message_buf, "reset: moving"); + if ((error = git_buf_printf(&log_message, "reset: moving to %s", to)) < 0) + return error; /* move HEAD to the new target */ if ((error = git_reference__update_terminal(repo, GIT_HEAD_FILE, - git_object_id(commit), signature, git_buf_cstr(&log_message_buf))) < 0) + git_object_id(commit), NULL, git_buf_cstr(&log_message))) < 0) goto cleanup; if (reset_type == GIT_RESET_HARD) { /* overwrite working directory with HEAD */ - opts.checkout_strategy = GIT_CHECKOUT_FORCE | GIT_CHECKOUT_SKIP_UNMERGED; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; if ((error = git_checkout_tree(repo, (git_object *)tree, &opts)) < 0) goto cleanup; @@ -176,7 +175,25 @@ git_object_free(commit); git_index_free(index); git_tree_free(tree); - git_buf_free(&log_message_buf); + git_buf_free(&log_message); return error; } + +int git_reset( + git_repository *repo, + git_object *target, + git_reset_t reset_type, + const git_checkout_options *checkout_opts) +{ + return reset(repo, target, git_oid_tostr_s(git_object_id(target)), reset_type, checkout_opts); +} + +int git_reset_from_annotated( + git_repository *repo, + git_annotated_commit *commit, + git_reset_t reset_type, + const git_checkout_options *checkout_opts) +{ + return reset(repo, (git_object *) commit->commit, commit->ref_name, reset_type, checkout_opts); +} diff -Nru libgit2-0.22.2/src/revert.c libgit2-0.23.1/src/revert.c --- libgit2-0.22.2/src/revert.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/revert.c 2015-08-03 18:07:35.000000000 +0000 @@ -9,6 +9,7 @@ #include "repository.h" #include "filebuf.h" #include "merge.h" +#include "index.h" #include "git2/types.h" #include "git2/merge.h" @@ -72,7 +73,7 @@ const char *their_label) { int error = 0; - unsigned int default_checkout_strategy = GIT_CHECKOUT_SAFE_CREATE | + unsigned int default_checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_ALLOW_CONFLICTS; GIT_UNUSED(repo); @@ -174,7 +175,8 @@ char commit_oidstr[GIT_OID_HEXSZ + 1]; const char *commit_msg; git_buf their_label = GIT_BUF_INIT; - git_index *index_new = NULL; + git_index *index = NULL; + git_indexwriter indexwriter = GIT_INDEXWRITER_INIT; int error; assert(repo && commit); @@ -194,14 +196,16 @@ if ((error = git_buf_printf(&their_label, "parent of %.7s... %s", commit_oidstr, commit_msg)) < 0 || (error = revert_normalize_opts(repo, &opts, given_opts, git_buf_cstr(&their_label))) < 0 || + (error = git_indexwriter_init_for_operation(&indexwriter, repo, &opts.checkout_opts.checkout_strategy)) < 0 || (error = write_revert_head(repo, commit_oidstr)) < 0 || (error = write_merge_msg(repo, commit_oidstr, commit_msg)) < 0 || (error = git_repository_head(&our_ref, repo)) < 0 || (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 || - (error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 || - (error = git_merge__check_result(repo, index_new)) < 0 || - (error = git_merge__append_conflicts_to_merge_msg(repo, index_new)) < 0 || - (error = git_checkout_index(repo, index_new, &opts.checkout_opts)) < 0) + (error = git_revert_commit(&index, repo, commit, our_commit, opts.mainline, &opts.merge_opts)) < 0 || + (error = git_merge__check_result(repo, index)) < 0 || + (error = git_merge__append_conflicts_to_merge_msg(repo, index)) < 0 || + (error = git_checkout_index(repo, index, &opts.checkout_opts)) < 0 || + (error = git_indexwriter_commit(&indexwriter)) < 0) goto on_error; goto done; @@ -210,7 +214,8 @@ revert_state_cleanup(repo); done: - git_index_free(index_new); + git_indexwriter_cleanup(&indexwriter); + git_index_free(index); git_commit_free(our_commit); git_reference_free(our_ref); git_buf_free(&their_label); diff -Nru libgit2-0.22.2/src/revwalk.c libgit2-0.23.1/src/revwalk.c --- libgit2-0.22.2/src/revwalk.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/revwalk.c 2015-08-03 18:07:35.000000000 +0000 @@ -14,6 +14,8 @@ #include "git2/revparse.h" #include "merge.h" +GIT__USE_OIDMAP + git_commit_list_node *git_revwalk__commit_lookup( git_revwalk *walk, const git_oid *oid) { @@ -39,11 +41,31 @@ return commit; } +typedef git_array_t(git_commit_list_node*) commit_list_node_array; + +static bool interesting_arr(commit_list_node_array arr) +{ + git_commit_list_node **n; + size_t i = 0, size; + + size = git_array_size(arr); + for (i = 0; i < size; i++) { + n = git_array_get(arr, i); + if (!*n) + break; + + if (!(*n)->uninteresting) + return true; + } + + return false; +} + static int mark_uninteresting(git_revwalk *walk, git_commit_list_node *commit) { int error; unsigned short i; - git_array_t(git_commit_list_node *) pending = GIT_ARRAY_INIT; + commit_list_node_array pending = GIT_ARRAY_INIT; git_commit_list_node **tmp; assert(commit); @@ -64,7 +86,7 @@ tmp = git_array_pop(pending); commit = tmp ? *tmp : NULL; - } while (commit != NULL); + } while (commit != NULL && !interesting_arr(pending)); git_array_clear(pending); @@ -142,6 +164,10 @@ if (commit == NULL) return -1; /* error already reported by failed lookup */ + /* A previous hide already told us we don't want this commit */ + if (commit->uninteresting) + return 0; + if (uninteresting) walk->did_hide = 1; else @@ -503,13 +529,9 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo) { - git_revwalk *walk; - - walk = git__malloc(sizeof(git_revwalk)); + git_revwalk *walk = git__calloc(1, sizeof(git_revwalk)); GITERR_CHECK_ALLOC(walk); - memset(walk, 0x0, sizeof(git_revwalk)); - walk->commits = git_oidmap_alloc(); GITERR_CHECK_ALLOC(walk->commits); diff -Nru libgit2-0.22.2/src/revwalk.h libgit2-0.23.1/src/revwalk.h --- libgit2-0.22.2/src/revwalk.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/revwalk.h 2015-08-03 18:07:35.000000000 +0000 @@ -14,7 +14,7 @@ #include "pool.h" #include "vector.h" -GIT__USE_OIDMAP; +#include "oidmap.h" struct git_revwalk { git_repository *repo; diff -Nru libgit2-0.22.2/src/settings.c libgit2-0.23.1/src/settings.c --- libgit2-0.22.2/src/settings.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/settings.c 2015-08-03 18:07:35.000000000 +0000 @@ -5,7 +5,7 @@ * a Linking Exception. For full terms see the included COPYING file. */ -#ifdef GIT_SSL +#ifdef GIT_OPENSSL # include #endif @@ -28,7 +28,7 @@ #ifdef GIT_THREADS | GIT_FEATURE_THREADS #endif -#if defined(GIT_SSL) || defined(GIT_WINHTTP) +#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) | GIT_FEATURE_HTTPS #endif #if defined(GIT_SSH) @@ -138,7 +138,7 @@ break; case GIT_OPT_SET_SSL_CERT_LOCATIONS: -#ifdef GIT_SSL +#ifdef GIT_OPENSSL { const char *file = va_arg(ap, const char *); const char *path = va_arg(ap, const char *); diff -Nru libgit2-0.22.2/src/sortedcache.c libgit2-0.23.1/src/sortedcache.c --- libgit2-0.22.2/src/sortedcache.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/sortedcache.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,6 +1,6 @@ #include "sortedcache.h" -GIT__USE_STRMAP; +GIT__USE_STRMAP int git_sortedcache_new( git_sortedcache **out, @@ -11,11 +11,13 @@ const char *path) { git_sortedcache *sc; - size_t pathlen; + size_t pathlen, alloclen; pathlen = path ? strlen(path) : 0; - sc = git__calloc(sizeof(git_sortedcache) + pathlen + 1, 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_sortedcache), pathlen); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + sc = git__calloc(1, alloclen); GITERR_CHECK_ALLOC(sc); if (git_pool_init(&sc->pool, 1, 0) < 0 || diff -Nru libgit2-0.22.2/src/stash.c libgit2-0.23.1/src/stash.c --- libgit2-0.22.2/src/stash.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/stash.c 2015-08-03 18:07:35.000000000 +0000 @@ -8,6 +8,7 @@ #include "common.h" #include "repository.h" #include "commit.h" +#include "message.h" #include "tree.h" #include "reflog.h" #include "git2/diff.h" @@ -16,7 +17,12 @@ #include "git2/checkout.h" #include "git2/index.h" #include "git2/transaction.h" +#include "git2/merge.h" +#include "index.h" #include "signature.h" +#include "iterator.h" +#include "merge.h" +#include "diff.h" static int create_error(int error, const char *msg) { @@ -49,23 +55,14 @@ static int append_commit_description(git_buf *out, git_commit* commit) { - const char *message; - size_t pos = 0, len; + const char *summary = git_commit_summary(commit); + GITERR_CHECK_ALLOC(summary); if (append_abbreviated_oid(out, git_commit_id(commit)) < 0) return -1; - message = git_commit_message(commit); - len = strlen(message); - - /* TODO: Replace with proper commit short message - * when git_commit_message_short() is implemented. - */ - while (pos < len && message[pos] != '\n') - pos++; - git_buf_putc(out, ' '); - git_buf_put(out, message, pos); + git_buf_puts(out, summary); git_buf_putc(out, '\n'); return git_buf_oom(out) ? -1 : 0; @@ -110,7 +107,7 @@ git_oid i_tree_oid; if ((error = git_index_write_tree(&i_tree_oid, index)) < 0) - return -1; + return error; return git_tree_lookup(out, git_index_owner(index), &i_tree_oid); } @@ -296,6 +293,25 @@ return error; } +static git_diff_delta *stash_delta_merge( + const git_diff_delta *a, + const git_diff_delta *b, + git_pool *pool) +{ + /* Special case for stash: if a file is deleted in the index, but exists + * in the working tree, we need to stash the workdir copy for the workdir. + */ + if (a->status == GIT_DELTA_DELETED && b->status == GIT_DELTA_UNTRACKED) { + git_diff_delta *dup = git_diff__delta_dup(b, pool); + + if (dup) + dup->status = GIT_DELTA_MODIFIED; + return dup; + } + + return git_diff__merge_like_cgit(a, b, pool); +} + static int build_workdir_tree( git_tree **tree_out, git_index *index, @@ -303,18 +319,19 @@ { git_repository *repo = git_index_owner(index); git_tree *b_tree = NULL; - git_diff *diff = NULL; + git_diff *diff = NULL, *idx_to_wd = NULL; git_diff_options opts = GIT_DIFF_OPTIONS_INIT; struct stash_update_rules data = {0}; int error; - opts.flags = GIT_DIFF_IGNORE_SUBMODULES; + opts.flags = GIT_DIFF_IGNORE_SUBMODULES | GIT_DIFF_INCLUDE_UNTRACKED; if ((error = git_commit_tree(&b_tree, b_commit)) < 0) goto cleanup; - if ((error = git_diff_tree_to_workdir_with_index( - &diff, repo, b_tree, &opts)) < 0) + if ((error = git_diff_tree_to_index(&diff, repo, b_tree, index, &opts)) < 0 || + (error = git_diff_index_to_workdir(&idx_to_wd, repo, index, &opts)) < 0 || + (error = git_diff__merge(diff, idx_to_wd, stash_delta_merge)) < 0) goto cleanup; data.include_changed = true; @@ -325,6 +342,7 @@ error = build_tree_from_index(tree_out, index); cleanup: + git_diff_free(idx_to_wd); git_diff_free(diff); git_tree_free(b_tree); @@ -411,7 +429,6 @@ static int update_reflog( git_oid *w_commit_oid, git_repository *repo, - const git_signature *stasher, const char *message) { git_reference *stash; @@ -420,7 +437,7 @@ if ((error = git_reference_ensure_log(repo, GIT_REFS_STASH_FILE)) < 0) return error; - error = git_reference_create(&stash, repo, GIT_REFS_STASH_FILE, w_commit_oid, 1, stasher, message); + error = git_reference_create(&stash, repo, GIT_REFS_STASH_FILE, w_commit_oid, 1, message); git_reference_free(stash); @@ -534,7 +551,7 @@ git_buf_rtrim(&msg); - if ((error = update_reflog(out, repo, stasher, git_buf_cstr(&msg))) < 0) + if ((error = update_reflog(out, repo, git_buf_cstr(&msg))) < 0) goto cleanup; if ((error = reset_index_and_workdir( @@ -555,6 +572,395 @@ return error; } +static int retrieve_stash_commit( + git_commit **commit, + git_repository *repo, + size_t index) +{ + git_reference *stash = NULL; + git_reflog *reflog = NULL; + int error; + size_t max; + const git_reflog_entry *entry; + + if ((error = git_reference_lookup(&stash, repo, GIT_REFS_STASH_FILE)) < 0) + goto cleanup; + + if ((error = git_reflog_read(&reflog, repo, GIT_REFS_STASH_FILE)) < 0) + goto cleanup; + + max = git_reflog_entrycount(reflog); + if (!max || index > max - 1) { + error = GIT_ENOTFOUND; + giterr_set(GITERR_STASH, "No stashed state at position %" PRIuZ, index); + goto cleanup; + } + + entry = git_reflog_entry_byindex(reflog, index); + if ((error = git_commit_lookup(commit, repo, git_reflog_entry_id_new(entry))) < 0) + goto cleanup; + +cleanup: + git_reference_free(stash); + git_reflog_free(reflog); + return error; +} + +static int retrieve_stash_trees( + git_tree **out_stash_tree, + git_tree **out_base_tree, + git_tree **out_index_tree, + git_tree **out_index_parent_tree, + git_tree **out_untracked_tree, + git_commit *stash_commit) +{ + git_tree *stash_tree = NULL; + git_commit *base_commit = NULL; + git_tree *base_tree = NULL; + git_commit *index_commit = NULL; + git_tree *index_tree = NULL; + git_commit *index_parent_commit = NULL; + git_tree *index_parent_tree = NULL; + git_commit *untracked_commit = NULL; + git_tree *untracked_tree = NULL; + int error; + + if ((error = git_commit_tree(&stash_tree, stash_commit)) < 0) + goto cleanup; + + if ((error = git_commit_parent(&base_commit, stash_commit, 0)) < 0) + goto cleanup; + if ((error = git_commit_tree(&base_tree, base_commit)) < 0) + goto cleanup; + + if ((error = git_commit_parent(&index_commit, stash_commit, 1)) < 0) + goto cleanup; + if ((error = git_commit_tree(&index_tree, index_commit)) < 0) + goto cleanup; + + if ((error = git_commit_parent(&index_parent_commit, index_commit, 0)) < 0) + goto cleanup; + if ((error = git_commit_tree(&index_parent_tree, index_parent_commit)) < 0) + goto cleanup; + + if (git_commit_parentcount(stash_commit) == 3) { + if ((error = git_commit_parent(&untracked_commit, stash_commit, 2)) < 0) + goto cleanup; + if ((error = git_commit_tree(&untracked_tree, untracked_commit)) < 0) + goto cleanup; + } + + *out_stash_tree = stash_tree; + *out_base_tree = base_tree; + *out_index_tree = index_tree; + *out_index_parent_tree = index_parent_tree; + *out_untracked_tree = untracked_tree; + +cleanup: + git_commit_free(untracked_commit); + git_commit_free(index_parent_commit); + git_commit_free(index_commit); + git_commit_free(base_commit); + if (error < 0) { + git_tree_free(stash_tree); + git_tree_free(base_tree); + git_tree_free(index_tree); + git_tree_free(index_parent_tree); + git_tree_free(untracked_tree); + } + return error; +} + +static int merge_indexes( + git_index **out, + git_repository *repo, + git_tree *ancestor_tree, + git_index *ours_index, + git_index *theirs_index) +{ + git_iterator *ancestor = NULL, *ours = NULL, *theirs = NULL; + const git_iterator_flag_t flags = GIT_ITERATOR_DONT_IGNORE_CASE; + int error; + + if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, flags, NULL, NULL)) < 0 || + (error = git_iterator_for_index(&ours, ours_index, flags, NULL, NULL)) < 0 || + (error = git_iterator_for_index(&theirs, theirs_index, flags, NULL, NULL)) < 0) + goto done; + + error = git_merge__iterators(out, repo, ancestor, ours, theirs, NULL); + +done: + git_iterator_free(ancestor); + git_iterator_free(ours); + git_iterator_free(theirs); + return error; +} + +static int merge_index_and_tree( + git_index **out, + git_repository *repo, + git_tree *ancestor_tree, + git_index *ours_index, + git_tree *theirs_tree) +{ + git_iterator *ancestor = NULL, *ours = NULL, *theirs = NULL; + const git_iterator_flag_t flags = GIT_ITERATOR_DONT_IGNORE_CASE; + int error; + + if ((error = git_iterator_for_tree(&ancestor, ancestor_tree, flags, NULL, NULL)) < 0 || + (error = git_iterator_for_index(&ours, ours_index, flags, NULL, NULL)) < 0 || + (error = git_iterator_for_tree(&theirs, theirs_tree, flags, NULL, NULL)) < 0) + goto done; + + error = git_merge__iterators(out, repo, ancestor, ours, theirs, NULL); + +done: + git_iterator_free(ancestor); + git_iterator_free(ours); + git_iterator_free(theirs); + return error; +} + +static void normalize_apply_options( + git_stash_apply_options *opts, + const git_stash_apply_options *given_apply_opts) +{ + if (given_apply_opts != NULL) { + memcpy(opts, given_apply_opts, sizeof(git_stash_apply_options)); + } else { + git_stash_apply_options default_apply_opts = GIT_STASH_APPLY_OPTIONS_INIT; + memcpy(opts, &default_apply_opts, sizeof(git_stash_apply_options)); + } + + if ((opts->checkout_options.checkout_strategy & (GIT_CHECKOUT_SAFE | GIT_CHECKOUT_FORCE)) == 0) + opts->checkout_options.checkout_strategy = GIT_CHECKOUT_SAFE; + + if (!opts->checkout_options.our_label) + opts->checkout_options.our_label = "Updated upstream"; + + if (!opts->checkout_options.their_label) + opts->checkout_options.their_label = "Stashed changes"; +} + +int git_stash_apply_init_options(git_stash_apply_options *opts, unsigned int version) +{ + GIT_INIT_STRUCTURE_FROM_TEMPLATE( + opts, version, git_stash_apply_options, GIT_STASH_APPLY_OPTIONS_INIT); + return 0; +} + +#define NOTIFY_PROGRESS(opts, progress_type) \ + do { \ + if ((opts).progress_cb && \ + (error = (opts).progress_cb((progress_type), (opts).progress_payload))) { \ + error = (error < 0) ? error : -1; \ + goto cleanup; \ + } \ + } while(false); + +static int ensure_clean_index(git_repository *repo, git_index *index) +{ + git_tree *head_tree = NULL; + git_diff *index_diff = NULL; + int error = 0; + + if ((error = git_repository_head_tree(&head_tree, repo)) < 0 || + (error = git_diff_tree_to_index( + &index_diff, repo, head_tree, index, NULL)) < 0) + goto done; + + if (git_diff_num_deltas(index_diff) > 0) { + giterr_set(GITERR_STASH, "%" PRIuZ " uncommitted changes exist in the index", + git_diff_num_deltas(index_diff)); + error = GIT_EUNCOMMITTED; + } + +done: + git_diff_free(index_diff); + git_tree_free(head_tree); + return error; +} + +static int stage_new_file(const git_index_entry **entries, void *data) +{ + git_index *index = data; + + if(entries[0] == NULL) + return git_index_add(index, entries[1]); + else + return git_index_add(index, entries[0]); +} + +static int stage_new_files( + git_index **out, + git_tree *parent_tree, + git_tree *tree) +{ + git_iterator *iterators[2] = { NULL, NULL }; + git_index *index = NULL; + int error; + + if ((error = git_index_new(&index)) < 0 || + (error = git_iterator_for_tree(&iterators[0], parent_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0 || + (error = git_iterator_for_tree(&iterators[1], tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)) < 0) + goto done; + + error = git_iterator_walk(iterators, 2, stage_new_file, index); + +done: + if (error < 0) + git_index_free(index); + else + *out = index; + + git_iterator_free(iterators[0]); + git_iterator_free(iterators[1]); + + return error; +} + +int git_stash_apply( + git_repository *repo, + size_t index, + const git_stash_apply_options *given_opts) +{ + git_stash_apply_options opts; + unsigned int checkout_strategy; + git_commit *stash_commit = NULL; + git_tree *stash_tree = NULL; + git_tree *stash_parent_tree = NULL; + git_tree *index_tree = NULL; + git_tree *index_parent_tree = NULL; + git_tree *untracked_tree = NULL; + git_index *stash_adds = NULL; + git_index *repo_index = NULL; + git_index *unstashed_index = NULL; + git_index *modified_index = NULL; + git_index *untracked_index = NULL; + int error; + + GITERR_CHECK_VERSION(given_opts, GIT_STASH_APPLY_OPTIONS_VERSION, "git_stash_apply_options"); + + normalize_apply_options(&opts, given_opts); + checkout_strategy = opts.checkout_options.checkout_strategy; + + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_LOADING_STASH); + + /* Retrieve commit corresponding to the given stash */ + if ((error = retrieve_stash_commit(&stash_commit, repo, index)) < 0) + goto cleanup; + + /* Retrieve all trees in the stash */ + if ((error = retrieve_stash_trees( + &stash_tree, &stash_parent_tree, &index_tree, + &index_parent_tree, &untracked_tree, stash_commit)) < 0) + goto cleanup; + + /* Load repo index */ + if ((error = git_repository_index(&repo_index, repo)) < 0) + goto cleanup; + + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_ANALYZE_INDEX); + + if ((error = ensure_clean_index(repo, repo_index)) < 0) + goto cleanup; + + /* Restore index if required */ + if ((opts.flags & GIT_STASH_APPLY_REINSTATE_INDEX) && + git_oid_cmp(git_tree_id(stash_parent_tree), git_tree_id(index_tree))) { + + if ((error = merge_index_and_tree( + &unstashed_index, repo, index_parent_tree, repo_index, index_tree)) < 0) + goto cleanup; + + if (git_index_has_conflicts(unstashed_index)) { + error = GIT_ECONFLICT; + goto cleanup; + } + + /* Otherwise, stage any new files in the stash tree. (Note: their + * previously unstaged contents are staged, not the previously staged.) + */ + } else if ((opts.flags & GIT_STASH_APPLY_REINSTATE_INDEX) == 0) { + if ((error = stage_new_files( + &stash_adds, stash_parent_tree, stash_tree)) < 0 || + (error = merge_indexes( + &unstashed_index, repo, stash_parent_tree, repo_index, stash_adds)) < 0) + goto cleanup; + } + + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED); + + /* Restore modified files in workdir */ + if ((error = merge_index_and_tree( + &modified_index, repo, stash_parent_tree, repo_index, stash_tree)) < 0) + goto cleanup; + + /* If applicable, restore untracked / ignored files in workdir */ + if (untracked_tree) { + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_ANALYZE_UNTRACKED); + + if ((error = merge_index_and_tree(&untracked_index, repo, NULL, repo_index, untracked_tree)) < 0) + goto cleanup; + } + + if (untracked_index) { + opts.checkout_options.checkout_strategy |= GIT_CHECKOUT_DONT_UPDATE_INDEX; + + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_CHECKOUT_UNTRACKED); + + if ((error = git_checkout_index(repo, untracked_index, &opts.checkout_options)) < 0) + goto cleanup; + + opts.checkout_options.checkout_strategy = checkout_strategy; + } + + + /* If there are conflicts in the modified index, then we need to actually + * check that out as the repo's index. Otherwise, we don't update the + * index. + */ + + if (!git_index_has_conflicts(modified_index)) + opts.checkout_options.checkout_strategy |= GIT_CHECKOUT_DONT_UPDATE_INDEX; + + /* Check out the modified index using the existing repo index as baseline, + * so that existing modifications in the index can be rewritten even when + * checking out safely. + */ + opts.checkout_options.baseline_index = repo_index; + + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_CHECKOUT_MODIFIED); + + if ((error = git_checkout_index(repo, modified_index, &opts.checkout_options)) < 0) + goto cleanup; + + if (unstashed_index && !git_index_has_conflicts(modified_index)) { + if ((error = git_index_read_index(repo_index, unstashed_index)) < 0) + goto cleanup; + } + + NOTIFY_PROGRESS(opts, GIT_STASH_APPLY_PROGRESS_DONE); + + error = git_index_write(repo_index); + +cleanup: + git_index_free(untracked_index); + git_index_free(modified_index); + git_index_free(unstashed_index); + git_index_free(stash_adds); + git_index_free(repo_index); + git_tree_free(untracked_tree); + git_tree_free(index_parent_tree); + git_tree_free(index_tree); + git_tree_free(stash_parent_tree); + git_tree_free(stash_tree); + git_commit_free(stash_commit); + return error; +} + int git_stash_foreach( git_repository *repo, git_stash_cb callback, @@ -622,7 +1028,7 @@ max = git_reflog_entrycount(reflog); - if (index > max - 1) { + if (!max || index > max - 1) { error = GIT_ENOTFOUND; giterr_set(GITERR_STASH, "No stashed state at position %" PRIuZ, index); goto cleanup; @@ -653,3 +1059,16 @@ git_reflog_free(reflog); return error; } + +int git_stash_pop( + git_repository *repo, + size_t index, + const git_stash_apply_options *options) +{ + int error; + + if ((error = git_stash_apply(repo, index, options)) < 0) + return error; + + return git_stash_drop(repo, index); +} diff -Nru libgit2-0.22.2/src/status.c libgit2-0.23.1/src/status.c --- libgit2-0.22.2/src/status.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/status.c 2015-08-03 18:07:35.000000000 +0000 @@ -44,6 +44,9 @@ case GIT_DELTA_TYPECHANGE: st = GIT_STATUS_INDEX_TYPECHANGE; break; + case GIT_DELTA_CONFLICTED: + st = GIT_STATUS_CONFLICTED; + break; default: break; } @@ -102,6 +105,9 @@ case GIT_DELTA_TYPECHANGE: st = GIT_STATUS_WT_TYPECHANGE; break; + case GIT_DELTA_CONFLICTED: + st = GIT_STATUS_CONFLICTED; + break; default: break; } diff -Nru libgit2-0.22.2/src/stransport_stream.c libgit2-0.23.1/src/stransport_stream.c --- libgit2-0.22.2/src/stransport_stream.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/stransport_stream.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,286 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#ifdef GIT_SECURE_TRANSPORT + +#include +#include +#include + +#include "git2/transport.h" + +#include "socket_stream.h" +#include "curl_stream.h" + +int stransport_error(OSStatus ret) +{ + CFStringRef message; + + if (ret == noErr || ret == errSSLClosedGraceful) { + giterr_clear(); + return 0; + } + +#if !TARGET_OS_IPHONE + message = SecCopyErrorMessageString(ret, NULL); + GITERR_CHECK_ALLOC(message); + + giterr_set(GITERR_NET, "SecureTransport error: %s", CFStringGetCStringPtr(message, kCFStringEncodingUTF8)); + CFRelease(message); +#else + giterr_set(GITERR_NET, "SecureTransport error: OSStatus %d", (unsigned int)ret); +#endif + + return -1; +} + +typedef struct { + git_stream parent; + git_stream *io; + SSLContextRef ctx; + CFDataRef der_data; + git_cert_x509 cert_info; +} stransport_stream; + +int stransport_connect(git_stream *stream) +{ + stransport_stream *st = (stransport_stream *) stream; + int error; + SecTrustRef trust = NULL; + SecTrustResultType sec_res; + OSStatus ret; + + if ((error = git_stream_connect(st->io)) < 0) + return error; + + ret = SSLHandshake(st->ctx); + if (ret != errSSLServerAuthCompleted) { + giterr_set(GITERR_SSL, "unexpected return value from ssl handshake %d", ret); + return -1; + } + + if ((ret = SSLCopyPeerTrust(st->ctx, &trust)) != noErr) + goto on_error; + + if ((ret = SecTrustEvaluate(trust, &sec_res)) != noErr) + goto on_error; + + CFRelease(trust); + + if (sec_res == kSecTrustResultInvalid || sec_res == kSecTrustResultOtherError) { + giterr_set(GITERR_SSL, "internal security trust error"); + return -1; + } + + if (sec_res == kSecTrustResultDeny || sec_res == kSecTrustResultRecoverableTrustFailure || + sec_res == kSecTrustResultFatalTrustFailure) + return GIT_ECERTIFICATE; + + return 0; + +on_error: + if (trust) + CFRelease(trust); + + return stransport_error(ret); +} + +int stransport_certificate(git_cert **out, git_stream *stream) +{ + stransport_stream *st = (stransport_stream *) stream; + SecTrustRef trust = NULL; + SecCertificateRef sec_cert; + OSStatus ret; + + if ((ret = SSLCopyPeerTrust(st->ctx, &trust)) != noErr) + return stransport_error(ret); + + sec_cert = SecTrustGetCertificateAtIndex(trust, 0); + st->der_data = SecCertificateCopyData(sec_cert); + CFRelease(trust); + + if (st->der_data == NULL) { + giterr_set(GITERR_SSL, "retrieved invalid certificate data"); + return -1; + } + + st->cert_info.cert_type = GIT_CERT_X509; + st->cert_info.data = (void *) CFDataGetBytePtr(st->der_data); + st->cert_info.len = CFDataGetLength(st->der_data); + + *out = (git_cert *)&st->cert_info; + return 0; +} + +int stransport_set_proxy(git_stream *stream, const char *proxy) +{ + stransport_stream *st = (stransport_stream *) stream; + + return git_stream_set_proxy(st->io, proxy); +} + +/* + * Contrary to typical network IO callbacks, Secure Transport write callback is + * expected to write *all* passed data, not just as much as it can, and any + * other case would be considered a failure. + * + * This behavior is actually not specified in the Apple documentation, but is + * required for things to work correctly (and incidentally, that's also how + * Apple implements it in its projects at opensource.apple.com). + * + * Libgit2 streams happen to already have this very behavior so this is just + * passthrough. + */ +static OSStatus write_cb(SSLConnectionRef conn, const void *data, size_t *len) +{ + git_stream *io = (git_stream *) conn; + + if (git_stream_write(io, data, *len, 0) < 0) { + return -36; /* "ioErr" from MacErrors.h which is not available on iOS */ + } + + return noErr; +} + +ssize_t stransport_write(git_stream *stream, const char *data, size_t len, int flags) +{ + stransport_stream *st = (stransport_stream *) stream; + size_t data_len, processed; + OSStatus ret; + + GIT_UNUSED(flags); + + data_len = len; + if ((ret = SSLWrite(st->ctx, data, data_len, &processed)) != noErr) + return stransport_error(ret); + + return processed; +} + +/* + * Contrary to typical network IO callbacks, Secure Transport read callback is + * expected to read *exactly* the requested number of bytes, not just as much + * as it can, and any other case would be considered a failure. + * + * This behavior is actually not specified in the Apple documentation, but is + * required for things to work correctly (and incidentally, that's also how + * Apple implements it in its projects at opensource.apple.com). + */ +static OSStatus read_cb(SSLConnectionRef conn, void *data, size_t *len) +{ + git_stream *io = (git_stream *) conn; + OSStatus error = noErr; + size_t off = 0; + ssize_t ret; + + do { + ret = git_stream_read(io, data + off, *len - off); + if (ret < 0) { + error = -36; /* "ioErr" from MacErrors.h which is not available on iOS */ + break; + } + if (ret == 0) { + error = errSSLClosedGraceful; + break; + } + + off += ret; + } while (off < *len); + + *len = off; + return error; +} + +ssize_t stransport_read(git_stream *stream, void *data, size_t len) +{ + stransport_stream *st = (stransport_stream *) stream; + size_t processed; + OSStatus ret; + + if ((ret = SSLRead(st->ctx, data, len, &processed)) != noErr) + return stransport_error(ret); + + return processed; +} + +int stransport_close(git_stream *stream) +{ + stransport_stream *st = (stransport_stream *) stream; + OSStatus ret; + + ret = SSLClose(st->ctx); + if (ret != noErr && ret != errSSLClosedGraceful) + return stransport_error(ret); + + return git_stream_close(st->io); +} + +void stransport_free(git_stream *stream) +{ + stransport_stream *st = (stransport_stream *) stream; + + git_stream_free(st->io); + CFRelease(st->ctx); + if (st->der_data) + CFRelease(st->der_data); + git__free(st); +} + +int git_stransport_stream_new(git_stream **out, const char *host, const char *port) +{ + stransport_stream *st; + int error; + OSStatus ret; + + assert(out && host); + + st = git__calloc(1, sizeof(stransport_stream)); + GITERR_CHECK_ALLOC(st); + +#ifdef GIT_CURL + error = git_curl_stream_new(&st->io, host, port); +#else + error = git_socket_stream_new(&st->io, host, port); +#endif + + if (error < 0){ + git__free(st); + return error; + } + + st->ctx = SSLCreateContext(NULL, kSSLClientSide, kSSLStreamType); + if (!st->ctx) { + giterr_set(GITERR_NET, "failed to create SSL context"); + return -1; + } + + if ((ret = SSLSetIOFuncs(st->ctx, read_cb, write_cb)) != noErr || + (ret = SSLSetConnection(st->ctx, st->io)) != noErr || + (ret = SSLSetSessionOption(st->ctx, kSSLSessionOptionBreakOnServerAuth, true)) != noErr || + (ret = SSLSetProtocolVersionMin(st->ctx, kTLSProtocol1)) != noErr || + (ret = SSLSetProtocolVersionMax(st->ctx, kTLSProtocol12)) != noErr || + (ret = SSLSetPeerDomainName(st->ctx, host, strlen(host))) != noErr) { + git_stream_free((git_stream *)st); + return stransport_error(ret); + } + + st->parent.version = GIT_STREAM_VERSION; + st->parent.encrypted = 1; + st->parent.proxy_support = git_stream_supports_proxy(st->io); + st->parent.connect = stransport_connect; + st->parent.certificate = stransport_certificate; + st->parent.set_proxy = stransport_set_proxy; + st->parent.read = stransport_read; + st->parent.write = stransport_write; + st->parent.close = stransport_close; + st->parent.free = stransport_free; + + *out = (git_stream *) st; + return 0; +} + +#endif diff -Nru libgit2-0.22.2/src/stransport_stream.h libgit2-0.23.1/src/stransport_stream.h --- libgit2-0.22.2/src/stransport_stream.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/stransport_stream.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,14 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_stransport_stream_h__ +#define INCLUDE_stransport_stream_h__ + +#include "git2/sys/stream.h" + +extern int git_stransport_stream_new(git_stream **out, const char *host, const char *port); + +#endif diff -Nru libgit2-0.22.2/src/stream.h libgit2-0.23.1/src/stream.h --- libgit2-0.22.2/src/stream.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/stream.h 2015-08-03 18:07:35.000000000 +0000 @@ -30,6 +30,21 @@ return st->certificate(out, st); } +GIT_INLINE(int) git_stream_supports_proxy(git_stream *st) +{ + return st->proxy_support; +} + +GIT_INLINE(int) git_stream_set_proxy(git_stream *st, const char *proxy_url) +{ + if (!st->proxy_support) { + giterr_set(GITERR_INVALID, "proxy not supported on this stream"); + return -1; + } + + return st->set_proxy(st, proxy_url); +} + GIT_INLINE(ssize_t) git_stream_read(git_stream *st, void *data, size_t len) { return st->read(st, data, len); diff -Nru libgit2-0.22.2/src/strmap.h libgit2-0.23.1/src/strmap.h --- libgit2-0.22.2/src/strmap.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/strmap.h 2015-08-03 18:07:35.000000000 +0000 @@ -12,10 +12,11 @@ #define kmalloc git__malloc #define kcalloc git__calloc #define krealloc git__realloc +#define kreallocarray git__reallocarray #define kfree git__free #include "khash.h" -__KHASH_TYPE(str, const char *, void *); +__KHASH_TYPE(str, const char *, void *) typedef khash_t(str) git_strmap; typedef khiter_t git_strmap_iter; diff -Nru libgit2-0.22.2/src/submodule.c libgit2-0.23.1/src/submodule.c --- libgit2-0.22.2/src/submodule.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/submodule.c 2015-08-03 18:07:35.000000000 +0000 @@ -85,19 +85,18 @@ __KHASH_IMPL( str, static kh_inline, const char *, void *, 1, - str_hash_no_trailing_slash, str_equal_no_trailing_slash); + str_hash_no_trailing_slash, str_equal_no_trailing_slash) -static int submodule_cache_init(git_repository *repo, int refresh); -static void submodule_cache_free(git_submodule_cache *cache); - -static git_config_backend *open_gitmodules(git_submodule_cache *, int gitmod); +static int submodule_alloc(git_submodule **out, git_repository *repo, const char *name); +static git_config_backend *open_gitmodules(git_repository *repo, int gitmod); static int get_url_base(git_buf *url, git_repository *repo); static int lookup_head_remote_key(git_buf *remote_key, git_repository *repo); -static int submodule_get(git_submodule **, git_submodule_cache *, const char *, const char *); static int submodule_load_from_config(const git_config_entry *, void *); static int submodule_load_from_wd_lite(git_submodule *); static void submodule_get_index_status(unsigned int *, git_submodule *); static void submodule_get_wd_status(unsigned int *, git_submodule *, git_repository *, git_submodule_ignore_t); +static void submodule_update_from_index_entry(git_submodule *sm, const git_index_entry *ie); +static void submodule_update_from_head_data(git_submodule *sm, mode_t mode, const git_oid *id); static int submodule_cmp(const void *a, const void *b) { @@ -111,69 +110,10 @@ return git_buf_puts(key, suffix); } -/* lookup submodule or return ENOTFOUND if it doesn't exist */ -static int submodule_lookup( - git_submodule **out, - git_submodule_cache *cache, - const char *name, - const char *alternate) -{ - khiter_t pos; - - /* lock cache */ - - pos = git_strmap_lookup_index(cache->submodules, name); - - if (!git_strmap_valid_index(cache->submodules, pos) && alternate) - pos = git_strmap_lookup_index(cache->submodules, alternate); - - if (!git_strmap_valid_index(cache->submodules, pos)) { - /* unlock cache */ - return GIT_ENOTFOUND; /* don't set error - caller will cope */ - } - - if (out != NULL) { - git_submodule *sm = git_strmap_value_at(cache->submodules, pos); - GIT_REFCOUNT_INC(sm); - *out = sm; - } - - /* unlock cache */ - - return 0; -} - -/* clear a set of flags on all submodules */ -static void submodule_cache_clear_flags( - git_submodule_cache *cache, uint32_t mask) -{ - git_submodule *sm; - uint32_t inverted_mask = ~mask; - - git_strmap_foreach_value(cache->submodules, sm, { - sm->flags &= inverted_mask; - }); -} - /* * PUBLIC APIS */ -bool git_submodule__is_submodule(git_repository *repo, const char *name) -{ - git_strmap *map; - - if (submodule_cache_init(repo, CACHE_OK) < 0) { - giterr_clear(); - return false; - } - - if (!repo->_submodules || !(map = repo->_submodules->submodules)) - return false; - - return git_strmap_valid_index(map, git_strmap_lookup_index(map, name)); -} - static void submodule_set_lookup_error(int error, const char *name) { if (!error) @@ -184,44 +124,105 @@ "Submodule '%s' has not been added yet", name); } -int git_submodule__lookup( +typedef struct { + const char *path; + char *name; +} fbp_data; + +static int find_by_path(const git_config_entry *entry, void *payload) +{ + fbp_data *data = payload; + + if (!strcmp(entry->value, data->path)) { + const char *fdot, *ldot; + fdot = strchr(entry->name, '.'); + ldot = strrchr(entry->name, '.'); + data->name = git__strndup(fdot + 1, ldot - fdot - 1); + GITERR_CHECK_ALLOC(data->name); + } + + return 0; +} + +int git_submodule_lookup( git_submodule **out, /* NULL if user only wants to test existence */ git_repository *repo, const char *name) /* trailing slash is allowed */ { int error; + unsigned int location; + git_submodule *sm; assert(repo && name); - if ((error = submodule_cache_init(repo, CACHE_OK)) < 0) + if ((error = submodule_alloc(&sm, repo, name)) < 0) return error; - if ((error = submodule_lookup(out, repo->_submodules, name, NULL)) < 0) - submodule_set_lookup_error(error, name); + if ((error = git_submodule_reload(sm, false)) < 0) { + git_submodule_free(sm); + return error; + } - return error; -} + if ((error = git_submodule_location(&location, sm)) < 0) { + git_submodule_free(sm); + return error; + } -int git_submodule_lookup( - git_submodule **out, /* NULL if user only wants to test existence */ - git_repository *repo, - const char *name) /* trailing slash is allowed */ -{ - int error; + /* If it's not configured or we're looking by path */ + if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) { + git_config_backend *mods; + const char *pattern = "submodule\\..*\\.path"; + git_buf path = GIT_BUF_INIT; + fbp_data data = { NULL, NULL }; - assert(repo && name); + git_buf_puts(&path, name); + while (path.ptr[path.size-1] == '/') { + path.ptr[--path.size] = '\0'; + } + data.path = path.ptr; + + mods = open_gitmodules(repo, GITMODULES_EXISTING); + + if (mods) + error = git_config_file_foreach_match(mods, pattern, find_by_path, &data); + + git_config_file_free(mods); + + if (error < 0) { + git_submodule_free(sm); + return error; + } - if ((error = submodule_cache_init(repo, CACHE_REFRESH)) < 0) + if (data.name) { + git__free(sm->name); + sm->name = data.name; + sm->path = git_buf_detach(&path); + + /* Try to load again with the right name */ + if ((error = git_submodule_reload(sm, false)) < 0) { + git_submodule_free(sm); + return error; + } + } + + git_buf_free(&path); + } + + if ((error = git_submodule_location(&location, sm)) < 0) { + git_submodule_free(sm); return error; + } - if ((error = submodule_lookup(out, repo->_submodules, name, NULL)) < 0) { + /* If we still haven't found it, do the WD check */ + if (location == 0 || location == GIT_SUBMODULE_STATUS_IN_WD) { + git_submodule_free(sm); + error = GIT_ENOTFOUND; - /* check if a plausible submodule exists at path */ + /* If it's not configured, we still check if there's a repo at the path */ if (git_repository_workdir(repo)) { git_buf path = GIT_BUF_INIT; - if (git_buf_join3(&path, - '/', git_repository_workdir(repo), name, DOT_GIT) < 0) + '/', git_repository_workdir(repo), name, DOT_GIT) < 0) return -1; if (git_path_exists(path.ptr)) @@ -231,9 +232,15 @@ } submodule_set_lookup_error(error, name); + return error; } - return error; + if (out) + *out = sm; + else + git_submodule_free(sm); + + return 0; } static void submodule_free_dup(void *sm) @@ -241,41 +248,221 @@ git_submodule_free(sm); } +static int submodule_get_or_create(git_submodule **out, git_repository *repo, git_strmap *map, const char *name) +{ + int error = 0; + khiter_t pos; + git_submodule *sm = NULL; + + pos = git_strmap_lookup_index(map, name); + if (git_strmap_valid_index(map, pos)) { + sm = git_strmap_value_at(map, pos); + goto done; + } + + /* if the submodule doesn't exist yet in the map, create it */ + if ((error = submodule_alloc(&sm, repo, name)) < 0) + return error; + + pos = kh_put(str, map, sm->name, &error); + /* nobody can beat us to adding it */ + assert(error != 0); + if (error < 0) { + git_submodule_free(sm); + return error; + } + + git_strmap_set_value_at(map, pos, sm); + +done: + GIT_REFCOUNT_INC(sm); + *out = sm; + return 0; +} + +static int submodules_from_index(git_strmap *map, git_index *idx) +{ + int error; + git_iterator *i; + const git_index_entry *entry; + + if ((error = git_iterator_for_index(&i, idx, 0, NULL, NULL)) < 0) + return error; + + while (!(error = git_iterator_advance(&entry, i))) { + khiter_t pos = git_strmap_lookup_index(map, entry->path); + git_submodule *sm; + + if (git_strmap_valid_index(map, pos)) { + sm = git_strmap_value_at(map, pos); + + if (S_ISGITLINK(entry->mode)) + submodule_update_from_index_entry(sm, entry); + else + sm->flags |= GIT_SUBMODULE_STATUS__INDEX_NOT_SUBMODULE; + } else if (S_ISGITLINK(entry->mode)) { + if (!submodule_get_or_create(&sm, git_index_owner(idx), map, entry->path)) { + submodule_update_from_index_entry(sm, entry); + git_submodule_free(sm); + } + } + } + + if (error == GIT_ITEROVER) + error = 0; + + git_iterator_free(i); + + return error; +} + +static int submodules_from_head(git_strmap *map, git_tree *head) +{ + int error; + git_iterator *i; + const git_index_entry *entry; + + if ((error = git_iterator_for_tree(&i, head, 0, NULL, NULL)) < 0) + return error; + + while (!(error = git_iterator_advance(&entry, i))) { + khiter_t pos = git_strmap_lookup_index(map, entry->path); + git_submodule *sm; + + if (git_strmap_valid_index(map, pos)) { + sm = git_strmap_value_at(map, pos); + + if (S_ISGITLINK(entry->mode)) + submodule_update_from_head_data(sm, entry->mode, &entry->id); + else + sm->flags |= GIT_SUBMODULE_STATUS__HEAD_NOT_SUBMODULE; + } else if (S_ISGITLINK(entry->mode)) { + if (!submodule_get_or_create(&sm, git_tree_owner(head), map, entry->path)) { + submodule_update_from_head_data( + sm, entry->mode, &entry->id); + git_submodule_free(sm); + } + } + } + + if (error == GIT_ITEROVER) + error = 0; + + git_iterator_free(i); + + return error; +} + +/* If have_sm is true, sm is populated, otherwise map an repo are. */ +typedef struct { + int have_sm; + git_submodule *sm; + git_strmap *map; + git_repository *repo; +} lfc_data; + +static int all_submodules(git_repository *repo, git_strmap *map) +{ + int error = 0; + git_index *idx = NULL; + git_tree *head = NULL; + const char *wd = NULL; + git_buf path = GIT_BUF_INIT; + git_submodule *sm; + git_config_backend *mods = NULL; + uint32_t mask; + + assert(repo && map); + + /* get sources that we will need to check */ + if (git_repository_index(&idx, repo) < 0) + giterr_clear(); + if (git_repository_head_tree(&head, repo) < 0) + giterr_clear(); + + wd = git_repository_workdir(repo); + if (wd && (error = git_buf_joinpath(&path, wd, GIT_MODULES_FILE)) < 0) + goto cleanup; + + /* clear submodule flags that are to be refreshed */ + mask = 0; + mask |= GIT_SUBMODULE_STATUS_IN_INDEX | + GIT_SUBMODULE_STATUS__INDEX_FLAGS | + GIT_SUBMODULE_STATUS__INDEX_OID_VALID | + GIT_SUBMODULE_STATUS__INDEX_MULTIPLE_ENTRIES; + + mask |= GIT_SUBMODULE_STATUS_IN_HEAD | + GIT_SUBMODULE_STATUS__HEAD_OID_VALID; + mask |= GIT_SUBMODULE_STATUS_IN_CONFIG; + if (mask != 0) + mask |= GIT_SUBMODULE_STATUS_IN_WD | + GIT_SUBMODULE_STATUS__WD_SCANNED | + GIT_SUBMODULE_STATUS__WD_FLAGS | + GIT_SUBMODULE_STATUS__WD_OID_VALID; + + /* add back submodule information from index */ + if (idx) { + if ((error = submodules_from_index(map, idx)) < 0) + goto cleanup; + } + /* add submodule information from HEAD */ + if (head) { + if ((error = submodules_from_head(map, head)) < 0) + goto cleanup; + } + /* add submodule information from .gitmodules */ + if (wd) { + lfc_data data = { 0 }; + data.map = map; + data.repo = repo; + if ((mods = open_gitmodules(repo, false)) != NULL && + (error = git_config_file_foreach( + mods, submodule_load_from_config, &data)) < 0) + goto cleanup; + } + /* shallow scan submodules in work tree as needed */ + if (wd && mask != 0) { + git_strmap_foreach_value(map, sm, { + submodule_load_from_wd_lite(sm); + }); + } + +cleanup: + git_config_file_free(mods); + /* TODO: if we got an error, mark submodule config as invalid? */ + git_index_free(idx); + git_tree_free(head); + git_buf_free(&path); + return error; +} + int git_submodule_foreach( git_repository *repo, int (*callback)(git_submodule *sm, const char *name, void *payload), void *payload) { + git_vector snapshot = GIT_VECTOR_INIT; + git_strmap *submodules; + git_submodule *sm; int error; size_t i; - git_submodule *sm; - git_submodule_cache *cache; - git_vector snapshot = GIT_VECTOR_INIT; - assert(repo && callback); - - if ((error = submodule_cache_init(repo, CACHE_REFRESH)) < 0) + if ((error = git_strmap_alloc(&submodules)) < 0) return error; - cache = repo->_submodules; - - if (git_mutex_lock(&cache->lock) < 0) { - giterr_set(GITERR_OS, "Unable to acquire lock on submodule cache"); - return -1; - } + if ((error = all_submodules(repo, submodules)) < 0) + goto done; if (!(error = git_vector_init( - &snapshot, kh_size(cache->submodules), submodule_cmp))) { + &snapshot, kh_size(submodules), submodule_cmp))) { - git_strmap_foreach_value(cache->submodules, sm, { + git_strmap_foreach_value(submodules, sm, { if ((error = git_vector_insert(&snapshot, sm)) < 0) break; GIT_REFCOUNT_INC(sm); }); } - git_mutex_unlock(&cache->lock); - if (error < 0) goto done; @@ -293,17 +480,12 @@ git_submodule_free(sm); git_vector_free(&snapshot); - return error; -} - -void git_submodule_cache_free(git_repository *repo) -{ - git_submodule_cache *cache; - - assert(repo); + git_strmap_foreach_value(submodules, sm, { + git_submodule_free(sm); + }); + git_strmap_free(submodules); - if ((cache = git__swap(repo->_submodules, NULL)) != NULL) - submodule_cache_free(cache); + return error; } static int submodule_repo_init( @@ -394,7 +576,7 @@ /* update .gitmodules */ - if (!(mods = open_gitmodules(repo->_submodules, GITMODULES_CREATE))) { + if (!(mods = open_gitmodules(repo, GITMODULES_CREATE))) { giterr_set(GITERR_SUBMODULE, "Adding submodules to a bare repository is not supported"); return -1; @@ -430,19 +612,10 @@ goto cleanup; } - /* add submodule to hash and "reload" it */ - - if (git_mutex_lock(&repo->_submodules->lock) < 0) { - giterr_set(GITERR_OS, "Unable to acquire lock on submodule cache"); - error = -1; + if ((error = git_submodule_lookup(&sm, repo, path)) < 0) goto cleanup; - } - - if (!(error = submodule_get(&sm, repo->_submodules, path, NULL)) && - !(error = git_submodule_reload(sm, false))) - error = git_submodule_init(sm, false); - git_mutex_unlock(&repo->_submodules->lock); + error = git_submodule_init(sm, false); cleanup: if (error && sm) { @@ -572,98 +745,15 @@ return error; } -const char *git_submodule_ignore_to_str(git_submodule_ignore_t ignore) -{ - int i; - for (i = 0; i < (int)ARRAY_SIZE(_sm_ignore_map); ++i) - if (_sm_ignore_map[i].map_value == ignore) - return _sm_ignore_map[i].str_match; - return NULL; -} - const char *git_submodule_update_to_str(git_submodule_update_t update) { int i; for (i = 0; i < (int)ARRAY_SIZE(_sm_update_map); ++i) - if (_sm_update_map[i].map_value == update) + if (_sm_update_map[i].map_value == (int)update) return _sm_update_map[i].str_match; return NULL; } -const char *git_submodule_recurse_to_str(git_submodule_recurse_t recurse) -{ - int i; - for (i = 0; i < (int)ARRAY_SIZE(_sm_recurse_map); ++i) - if (_sm_recurse_map[i].map_value == recurse) - return _sm_recurse_map[i].str_match; - return NULL; -} - -int git_submodule_save(git_submodule *submodule) -{ - int error = 0; - git_config_backend *mods; - git_buf key = GIT_BUF_INIT; - const char *val; - - assert(submodule); - - mods = open_gitmodules(submodule->repo->_submodules, GITMODULES_CREATE); - if (!mods) { - giterr_set(GITERR_SUBMODULE, - "Adding submodules to a bare repository is not supported"); - return -1; - } - - if ((error = git_buf_printf(&key, "submodule.%s.", submodule->name)) < 0) - goto cleanup; - - /* save values for path, url, update, ignore, fetchRecurseSubmodules */ - - if ((error = submodule_config_key_trunc_puts(&key, "path")) < 0 || - (error = git_config_file_set_string(mods, key.ptr, submodule->path)) < 0) - goto cleanup; - - if ((error = submodule_config_key_trunc_puts(&key, "url")) < 0 || - (error = git_config_file_set_string(mods, key.ptr, submodule->url)) < 0) - goto cleanup; - - if ((error = submodule_config_key_trunc_puts(&key, "branch")) < 0 || - (error = git_config_file_set_string(mods, key.ptr, submodule->branch)) < 0) - goto cleanup; - - if (!(error = submodule_config_key_trunc_puts(&key, "update")) && - (val = git_submodule_update_to_str(submodule->update)) != NULL) - error = git_config_file_set_string(mods, key.ptr, val); - if (error < 0) - goto cleanup; - - if (!(error = submodule_config_key_trunc_puts(&key, "ignore")) && - (val = git_submodule_ignore_to_str(submodule->ignore)) != NULL) - error = git_config_file_set_string(mods, key.ptr, val); - if (error < 0) - goto cleanup; - - if (!(error = submodule_config_key_trunc_puts(&key, "fetchRecurseSubmodules")) && - (val = git_submodule_recurse_to_str(submodule->fetch_recurse)) != NULL) - error = git_config_file_set_string(mods, key.ptr, val); - if (error < 0) - goto cleanup; - - /* update internal defaults */ - - submodule->ignore_default = submodule->ignore; - submodule->update_default = submodule->update; - submodule->fetch_recurse_default = submodule->fetch_recurse; - submodule->flags |= GIT_SUBMODULE_STATUS_IN_CONFIG; - -cleanup: - git_config_file_free(mods); - git_buf_free(&key); - - return error; -} - git_repository *git_submodule_owner(git_submodule *submodule) { assert(submodule); @@ -688,25 +778,81 @@ return submodule->url; } -int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *url) +int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *url) +{ + int error = 0; + git_buf normalized = GIT_BUF_INIT; + + assert(out && repo && url); + + git_buf_sanitize(out); + + if (strchr(url, '\\')) { + char *p; + if ((error = git_buf_puts(&normalized, url)) < 0) + return error; + + for (p = normalized.ptr; *p; p++) { + if (*p == '\\') + *p = '/'; + } + + url = normalized.ptr; + } + + if (git_path_is_relative(url)) { + if (!(error = get_url_base(out, repo))) + error = git_path_apply_relative(out, url); + } else if (strchr(url, ':') != NULL || url[0] == '/') { + error = git_buf_sets(out, url); + } else { + giterr_set(GITERR_SUBMODULE, "Invalid format for submodule URL"); + error = -1; + } + + git_buf_free(&normalized); + return error; +} + +static int write_var(git_repository *repo, const char *name, const char *var, const char *val) +{ + git_buf key = GIT_BUF_INIT; + git_config_backend *mods; + int error; + + mods = open_gitmodules(repo, GITMODULES_CREATE); + if (!mods) + return -1; + + if ((error = git_buf_printf(&key, "submodule.%s.%s", name, var)) < 0) + goto cleanup; + + if (val) + error = git_config_file_set_string(mods, key.ptr, val); + else + error = git_config_file_delete(mods, key.ptr); + + git_buf_free(&key); + +cleanup: + git_config_file_free(mods); + return error; +} + +static int write_mapped_var(git_repository *repo, const char *name, git_cvar_map *maps, size_t nmaps, const char *var, int ival) { - int error = 0; - - assert(out && repo && url); - - git_buf_sanitize(out); + git_cvar_t type; + const char *val; - if (git_path_is_relative(url)) { - if (!(error = get_url_base(out, repo))) - error = git_path_apply_relative(out, url); - } else if (strchr(url, ':') != NULL || url[0] == '/') { - error = git_buf_sets(out, url); - } else { - giterr_set(GITERR_SUBMODULE, "Invalid format for submodule URL"); - error = -1; + if (git_config_lookup_map_enum(&type, &val, maps, nmaps, ival) < 0) { + giterr_set(GITERR_SUBMODULE, "invalid value for %s", var); + return -1; } - return error; + if (type == GIT_CVAR_TRUE) + val = "true"; + + return write_var(repo, name, var, val); } const char *git_submodule_branch(git_submodule *submodule) @@ -715,16 +861,19 @@ return submodule->branch; } -int git_submodule_set_url(git_submodule *submodule, const char *url) +int git_submodule_set_branch(git_repository *repo, const char *name, const char *branch) { - assert(submodule && url); - git__free(submodule->url); + assert(repo && name); + + return write_var(repo, name, "branch", branch); +} - submodule->url = git__strdup(url); - GITERR_CHECK_ALLOC(submodule->url); +int git_submodule_set_url(git_repository *repo, const char *name, const char *url) +{ + assert(repo && name && url); - return 0; + return write_var(repo, name, "url", url); } const git_oid *git_submodule_index_id(git_submodule *submodule) @@ -775,19 +924,11 @@ GIT_SUBMODULE_IGNORE_NONE : submodule->ignore; } -git_submodule_ignore_t git_submodule_set_ignore( - git_submodule *submodule, git_submodule_ignore_t ignore) +int git_submodule_set_ignore(git_repository *repo, const char *name, git_submodule_ignore_t ignore) { - git_submodule_ignore_t old; - - assert(submodule); - - if (ignore == GIT_SUBMODULE_IGNORE_RESET) - ignore = submodule->ignore_default; + assert(repo && name); - old = submodule->ignore; - submodule->ignore = ignore; - return old; + return write_mapped_var(repo, name, _sm_ignore_map, ARRAY_SIZE(_sm_ignore_map), "ignore", ignore); } git_submodule_update_t git_submodule_update_strategy(git_submodule *submodule) @@ -797,19 +938,11 @@ GIT_SUBMODULE_UPDATE_CHECKOUT : submodule->update; } -git_submodule_update_t git_submodule_set_update( - git_submodule *submodule, git_submodule_update_t update) +int git_submodule_set_update(git_repository *repo, const char *name, git_submodule_update_t update) { - git_submodule_update_t old; - - assert(submodule); - - if (update == GIT_SUBMODULE_UPDATE_RESET) - update = submodule->update_default; + assert(repo && name); - old = submodule->update; - submodule->update = update; - return old; + return write_mapped_var(repo, name, _sm_update_map, ARRAY_SIZE(_sm_update_map), "update", update); } git_submodule_recurse_t git_submodule_fetch_recurse_submodules( @@ -819,20 +952,11 @@ return submodule->fetch_recurse; } -git_submodule_recurse_t git_submodule_set_fetch_recurse_submodules( - git_submodule *submodule, - git_submodule_recurse_t fetch_recurse_submodules) +int git_submodule_set_fetch_recurse_submodules(git_repository *repo, const char *name, git_submodule_recurse_t recurse) { - git_submodule_recurse_t old; - - assert(submodule); - - if (fetch_recurse_submodules == GIT_SUBMODULE_RECURSE_RESET) - fetch_recurse_submodules = submodule->fetch_recurse_default; + assert(repo && name); - old = submodule->fetch_recurse; - submodule->fetch_recurse = fetch_recurse_submodules; - return old; + return write_mapped_var(repo, name, _sm_recurse_map, ARRAY_SIZE(_sm_recurse_map), "fetchRecurseSubmodules", recurse); } static int submodule_repo_create( @@ -926,11 +1050,10 @@ GITERR_CHECK_VERSION(&update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, "git_submodule_update_options"); /* Copy over the remote callbacks */ - clone_options.remote_callbacks = update_options.remote_callbacks; - clone_options.signature = update_options.signature; + memcpy(&clone_options.fetch_opts, &update_options.fetch_opts, sizeof(git_fetch_options)); /* Get the status of the submodule to determine if it is already initialized */ - if ((error = git_submodule_status(&submodule_status, sm)) < 0) + if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0) goto done; /* @@ -985,7 +1108,7 @@ update_options.checkout_opts.checkout_strategy = update_options.clone_checkout_strategy; if ((error = git_clone(&sub_repo, submodule_url, sm->path, &clone_options)) < 0 || - (error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm), update_options.signature, NULL)) < 0 || + (error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm))) < 0 || (error = git_checkout_head(sub_repo, &update_options.checkout_opts)) != 0) goto done; } else { @@ -997,7 +1120,7 @@ if ((error = git_submodule_open(&sub_repo, sm)) < 0 || (error = git_object_lookup(&target_commit, sub_repo, git_submodule_index_id(sm), GIT_OBJ_COMMIT)) < 0 || (error = git_checkout_tree(sub_repo, target_commit, &update_options.checkout_opts)) != 0 || - (error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm), update_options.signature, NULL)) < 0) + (error = git_repository_set_head_detached(sub_repo, git_submodule_index_id(sm))) < 0) goto done; /* Invalidate the wd flags as the workdir has been updated. */ @@ -1092,10 +1215,10 @@ /* return error from reading submodule config */; else if ((error = lookup_head_remote_key(&remote_name, smrepo)) < 0) { giterr_clear(); - error = git_buf_sets(&key, "branch.origin.remote"); + error = git_buf_sets(&key, "remote.origin.url"); } else { error = git_buf_join3( - &key, '.', "branch", remote_name.ptr, "remote"); + &key, '.', "remote", remote_name.ptr, "url"); git_buf_free(&remote_name); } @@ -1174,11 +1297,6 @@ return git_submodule__open(subrepo, sm, false); } -int git_submodule_reload_all(git_repository *repo, int force) -{ - return submodule_cache_init(repo, force ? CACHE_FLUSH : CACHE_REFRESH); -} - static void submodule_update_from_index_entry( git_submodule *sm, const git_index_entry *ie) { @@ -1257,14 +1375,12 @@ { int error = 0; git_config_backend *mods; - git_submodule_cache *cache; + lfc_data data = { 0 }; GIT_UNUSED(force); assert(sm); - cache = sm->repo->_submodules; - /* refresh index data */ if ((error = submodule_update_index(sm)) < 0) return error; @@ -1278,19 +1394,22 @@ return error; /* refresh config data */ - mods = open_gitmodules(cache, GITMODULES_EXISTING); + mods = open_gitmodules(sm->repo, GITMODULES_EXISTING); if (mods != NULL) { git_buf path = GIT_BUF_INIT; git_buf_sets(&path, "submodule\\."); git_buf_text_puts_escape_regex(&path, sm->name); - git_buf_puts(&path, ".*"); + git_buf_puts(&path, "\\..*"); - if (git_buf_oom(&path)) + if (git_buf_oom(&path)) { error = -1; - else + } else { + data.have_sm = 1; + data.sm = sm; error = git_config_file_foreach_match( - mods, path.ptr, submodule_load_from_config, cache); + mods, path.ptr, submodule_load_from_config, &data); + } git_buf_free(&path); git_config_file_free(mods); @@ -1329,7 +1448,7 @@ unsigned int status; git_repository *smrepo = NULL; - if (ign < GIT_SUBMODULE_IGNORE_NONE) + if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED) ign = sm->ignore; /* only return location info if ignore == all */ @@ -1378,11 +1497,20 @@ return 0; } -int git_submodule_status(unsigned int *status, git_submodule *sm) +int git_submodule_status(unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore) { - assert(status && sm); + git_submodule *sm; + int error; - return git_submodule__status(status, NULL, NULL, NULL, sm, 0); + assert(status && repo && name); + + if ((error = git_submodule_lookup(&sm, repo, name)) < 0) + return error; + + error = git_submodule__status(status, NULL, NULL, NULL, sm, ignore); + git_submodule_free(sm); + + return error; } int git_submodule_location(unsigned int *location, git_submodule *sm) @@ -1399,7 +1527,7 @@ */ static int submodule_alloc( - git_submodule **out, git_submodule_cache *cache, const char *name) + git_submodule **out, git_repository *repo, const char *name) { size_t namelen; git_submodule *sm; @@ -1422,56 +1550,20 @@ sm->ignore = sm->ignore_default = GIT_SUBMODULE_IGNORE_NONE; sm->update = sm->update_default = GIT_SUBMODULE_UPDATE_CHECKOUT; sm->fetch_recurse = sm->fetch_recurse_default = GIT_SUBMODULE_RECURSE_NO; - sm->repo = cache->repo; + sm->repo = repo; sm->branch = NULL; *out = sm; return 0; } -static void submodule_cache_remove_item( - git_submodule_cache *cache, - git_submodule *item, - bool free_after_remove) -{ - git_strmap *map; - const char *name, *alt; - - if (!cache || !(map = cache->submodules) || !item) - return; - - name = item->name; - alt = (item->path != item->name) ? item->path : NULL; - - for (; name; name = alt, alt = NULL) { - khiter_t pos = git_strmap_lookup_index(map, name); - git_submodule *found; - - if (!git_strmap_valid_index(map, pos)) - continue; - - found = git_strmap_value_at(map, pos); - - if (found != item) - continue; - - git_strmap_set_value_at(map, pos, NULL); - git_strmap_delete_at(map, pos); - - if (free_after_remove) - git_submodule_free(found); - } -} - static void submodule_release(git_submodule *sm) { if (!sm) return; if (sm->repo) { - git_submodule_cache *cache = sm->repo->_submodules; sm->repo = NULL; - submodule_cache_remove_item(cache, sm, false); } if (sm->path != sm->name) @@ -1490,54 +1582,6 @@ GIT_REFCOUNT_DEC(sm, submodule_release); } -static int submodule_get( - git_submodule **out, - git_submodule_cache *cache, - const char *name, - const char *alternate) -{ - int error = 0; - khiter_t pos; - git_submodule *sm; - - pos = git_strmap_lookup_index(cache->submodules, name); - - if (!git_strmap_valid_index(cache->submodules, pos) && alternate) - pos = git_strmap_lookup_index(cache->submodules, alternate); - - if (!git_strmap_valid_index(cache->submodules, pos)) { - if ((error = submodule_alloc(&sm, cache, name)) < 0) - return error; - - /* insert value at name - if another thread beats us to it, then use - * their record and release our own. - */ - pos = kh_put(str, cache->submodules, sm->name, &error); - - if (error < 0) - goto done; - else if (error == 0) { - git_submodule_free(sm); - sm = git_strmap_value_at(cache->submodules, pos); - } else { - error = 0; - git_strmap_set_value_at(cache->submodules, pos, sm); - } - } else { - sm = git_strmap_value_at(cache->submodules, pos); - } - -done: - if (error < 0) - git_submodule_free(sm); - else if (out) { - GIT_REFCOUNT_INC(sm); - *out = sm; - } - - return error; -} - static int submodule_config_error(const char *property, const char *value) { giterr_set(GITERR_INVALID, @@ -1590,12 +1634,12 @@ static int submodule_load_from_config( const git_config_entry *entry, void *payload) { - git_submodule_cache *cache = payload; const char *namestart, *property; const char *key = entry->name, *value = entry->value, *path; char *alternate = NULL, *replaced = NULL; git_buf name = GIT_BUF_INIT; - git_submodule *sm = NULL; + lfc_data *data = payload; + git_submodule *sm; int error = 0; if (git__prefixcmp(key, "submodule.") != 0) @@ -1610,10 +1654,29 @@ property++; path = !strcasecmp(property, "path") ? value : NULL; - if ((error = git_buf_set(&name, namestart, property - namestart - 1)) < 0 || - (error = submodule_get(&sm, cache, name.ptr, path)) < 0) + if ((error = git_buf_set(&name, namestart, property - namestart -1)) < 0) goto done; + if (data->have_sm) { + sm = data->sm; + } else { + khiter_t pos; + git_strmap *map = data->map; + pos = git_strmap_lookup_index(map, path ? path : name.ptr); + if (git_strmap_valid_index(map, pos)) { + sm = git_strmap_value_at(map, pos); + } else { + if ((error = submodule_alloc(&sm, data->repo, name.ptr)) < 0) + goto done; + + git_strmap_insert(map, sm->name, sm, error); + assert(error != 0); + if (error < 0) + goto done; + error = 0; + } + } + sm->flags |= GIT_SUBMODULE_STATUS_IN_CONFIG; /* Only from config might we get differing names & paths. If so, then @@ -1625,7 +1688,7 @@ */ if (strcmp(sm->name, name.ptr) != 0) { /* name changed */ - if (!strcmp(sm->path, name.ptr)) { /* already set as path */ + if (sm->path && !strcmp(sm->path, name.ptr)) { /* already set as path */ replaced = sm->name; sm->name = sm->path; } else { @@ -1651,30 +1714,9 @@ /* Deregister under name being replaced */ if (replaced) { - git_strmap_delete(cache->submodules, replaced); - git_submodule_free(sm); git__free(replaced); } - /* Insert under alternate key */ - if (alternate) { - void *old_sm = NULL; - git_strmap_insert2(cache->submodules, alternate, sm, old_sm, error); - - if (error < 0) - goto done; - if (error > 0) - error = 0; - - GIT_REFCOUNT_INC(sm); /* increase refcount for new key */ - - /* if we replaced an old module under this key, release the old one */ - if (old_sm && ((git_submodule *)old_sm) != sm) { - git_submodule_free(old_sm); - /* TODO: log warning about multiple submodules with same path */ - } - } - /* TODO: Look up path in index and if it is present but not a GITLINK * then this should be deleted (at least to match git's behavior) */ @@ -1719,7 +1761,6 @@ /* ignore other unknown submodule properties */ done: - git_submodule_free(sm); /* offset refcount inc from submodule_get() */ git_buf_free(&name); return error; } @@ -1741,86 +1782,11 @@ return 0; } -static int submodule_cache_refresh_from_index( - git_submodule_cache *cache, git_index *idx) -{ - int error; - git_iterator *i; - const git_index_entry *entry; - - if ((error = git_iterator_for_index(&i, idx, 0, NULL, NULL)) < 0) - return error; - - while (!(error = git_iterator_advance(&entry, i))) { - khiter_t pos = git_strmap_lookup_index(cache->submodules, entry->path); - git_submodule *sm; - - if (git_strmap_valid_index(cache->submodules, pos)) { - sm = git_strmap_value_at(cache->submodules, pos); - - if (S_ISGITLINK(entry->mode)) - submodule_update_from_index_entry(sm, entry); - else - sm->flags |= GIT_SUBMODULE_STATUS__INDEX_NOT_SUBMODULE; - } else if (S_ISGITLINK(entry->mode)) { - if (!submodule_get(&sm, cache, entry->path, NULL)) { - submodule_update_from_index_entry(sm, entry); - git_submodule_free(sm); - } - } - } - - if (error == GIT_ITEROVER) - error = 0; - - git_iterator_free(i); - - return error; -} - -static int submodule_cache_refresh_from_head( - git_submodule_cache *cache, git_tree *head) -{ - int error; - git_iterator *i; - const git_index_entry *entry; - - if ((error = git_iterator_for_tree(&i, head, 0, NULL, NULL)) < 0) - return error; - - while (!(error = git_iterator_advance(&entry, i))) { - khiter_t pos = git_strmap_lookup_index(cache->submodules, entry->path); - git_submodule *sm; - - if (git_strmap_valid_index(cache->submodules, pos)) { - sm = git_strmap_value_at(cache->submodules, pos); - - if (S_ISGITLINK(entry->mode)) - submodule_update_from_head_data(sm, entry->mode, &entry->id); - else - sm->flags |= GIT_SUBMODULE_STATUS__HEAD_NOT_SUBMODULE; - } else if (S_ISGITLINK(entry->mode)) { - if (!submodule_get(&sm, cache, entry->path, NULL)) { - submodule_update_from_head_data( - sm, entry->mode, &entry->id); - git_submodule_free(sm); - } - } - } - - if (error == GIT_ITEROVER) - error = 0; - - git_iterator_free(i); - - return error; -} - static git_config_backend *open_gitmodules( - git_submodule_cache *cache, + git_repository *repo, int okay_to_create) { - const char *workdir = git_repository_workdir(cache->repo); + const char *workdir = git_repository_workdir(repo); git_buf path = GIT_BUF_INIT; git_config_backend *mods = NULL; @@ -1845,199 +1811,6 @@ return mods; } -static void submodule_cache_free(git_submodule_cache *cache) -{ - git_submodule *sm; - - if (!cache) - return; - - git_strmap_foreach_value(cache->submodules, sm, { - sm->repo = NULL; /* disconnect from repo */ - git_submodule_free(sm); - }); - git_strmap_free(cache->submodules); - - git_buf_free(&cache->gitmodules_path); - git_mutex_free(&cache->lock); - git__free(cache); -} - -static int submodule_cache_alloc( - git_submodule_cache **out, git_repository *repo) -{ - git_submodule_cache *cache = git__calloc(1, sizeof(git_submodule_cache)); - GITERR_CHECK_ALLOC(cache); - - if (git_mutex_init(&cache->lock) < 0) { - giterr_set(GITERR_OS, "Unable to initialize submodule cache lock"); - git__free(cache); - return -1; - } - - if (git_strmap_alloc(&cache->submodules) < 0) { - submodule_cache_free(cache); - return -1; - } - - cache->repo = repo; - git_buf_init(&cache->gitmodules_path, 0); - - *out = cache; - return 0; -} - -static int submodule_cache_refresh(git_submodule_cache *cache, int refresh) -{ - int error = 0, update_index, update_head, update_gitmod; - git_index *idx = NULL; - git_tree *head = NULL; - const char *wd = NULL; - git_buf path = GIT_BUF_INIT; - git_submodule *sm; - git_config_backend *mods = NULL; - uint32_t mask; - - if (!cache || !cache->repo || !refresh) - return 0; - - if (git_mutex_lock(&cache->lock) < 0) { - giterr_set(GITERR_OS, "Unable to acquire lock on submodule cache"); - return -1; - } - - /* get sources that we will need to check */ - - if (git_repository_index(&idx, cache->repo) < 0) - giterr_clear(); - if (git_repository_head_tree(&head, cache->repo) < 0) - giterr_clear(); - - wd = git_repository_workdir(cache->repo); - if (wd && (error = git_buf_joinpath(&path, wd, GIT_MODULES_FILE)) < 0) - goto cleanup; - - /* check for invalidation */ - - if (refresh == CACHE_FLUSH) - update_index = update_head = update_gitmod = true; - else { - update_index = - !idx || git_index__changed_relative_to(idx, &cache->index_stamp); - update_head = - !head || !git_oid_equal(&cache->head_id, git_tree_id(head)); - - update_gitmod = (wd != NULL) ? - git_futils_filestamp_check(&cache->gitmodules_stamp, path.ptr) : - (cache->gitmodules_stamp.mtime != 0); - } - - /* clear submodule flags that are to be refreshed */ - - mask = 0; - if (!idx || update_index) - mask |= GIT_SUBMODULE_STATUS_IN_INDEX | - GIT_SUBMODULE_STATUS__INDEX_FLAGS | - GIT_SUBMODULE_STATUS__INDEX_OID_VALID | - GIT_SUBMODULE_STATUS__INDEX_MULTIPLE_ENTRIES; - if (!head || update_head) - mask |= GIT_SUBMODULE_STATUS_IN_HEAD | - GIT_SUBMODULE_STATUS__HEAD_OID_VALID; - if (update_gitmod) - mask |= GIT_SUBMODULE_STATUS_IN_CONFIG; - if (mask != 0) - mask |= GIT_SUBMODULE_STATUS_IN_WD | - GIT_SUBMODULE_STATUS__WD_SCANNED | - GIT_SUBMODULE_STATUS__WD_FLAGS | - GIT_SUBMODULE_STATUS__WD_OID_VALID; - else - goto cleanup; /* nothing to do */ - - submodule_cache_clear_flags(cache, mask); - - /* add back submodule information from index */ - - if (idx && update_index) { - if ((error = submodule_cache_refresh_from_index(cache, idx)) < 0) - goto cleanup; - - git_futils_filestamp_set( - &cache->index_stamp, git_index__filestamp(idx)); - } - - /* add submodule information from HEAD */ - - if (head && update_head) { - if ((error = submodule_cache_refresh_from_head(cache, head)) < 0) - goto cleanup; - - git_oid_cpy(&cache->head_id, git_tree_id(head)); - } - - /* add submodule information from .gitmodules */ - - if (wd && update_gitmod > 0) { - if ((mods = open_gitmodules(cache, false)) != NULL && - (error = git_config_file_foreach( - mods, submodule_load_from_config, cache)) < 0) - goto cleanup; - } - - /* shallow scan submodules in work tree as needed */ - - if (wd && mask != 0) { - git_strmap_foreach_value(cache->submodules, sm, { - submodule_load_from_wd_lite(sm); - }); - } - - /* remove submodules that no longer exist */ - - git_strmap_foreach_value(cache->submodules, sm, { - /* purge unless in HEAD, index, or .gitmodules; no sm for wd only */ - if (sm != NULL && - !(sm->flags & - (GIT_SUBMODULE_STATUS_IN_HEAD | - GIT_SUBMODULE_STATUS_IN_INDEX | - GIT_SUBMODULE_STATUS_IN_CONFIG))) - submodule_cache_remove_item(cache, sm, true); - }); - -cleanup: - git_config_file_free(mods); - - /* TODO: if we got an error, mark submodule config as invalid? */ - - git_mutex_unlock(&cache->lock); - - git_index_free(idx); - git_tree_free(head); - git_buf_free(&path); - - return error; -} - -static int submodule_cache_init(git_repository *repo, int cache_refresh) -{ - int error = 0; - git_submodule_cache *cache = NULL; - - /* if submodules already exist, just refresh as requested */ - if (repo->_submodules) - return submodule_cache_refresh(repo->_submodules, cache_refresh); - - /* otherwise create a new cache, load it, and atomically swap it in */ - if (!(error = submodule_cache_alloc(&cache, repo)) && - !(error = submodule_cache_refresh(cache, CACHE_FLUSH))) - cache = git__compare_and_swap(&repo->_submodules, NULL, cache); - - /* might have raced with another thread to set cache, so free if needed */ - if (cache) - submodule_cache_free(cache); - - return error; -} - /* Lookup name of remote of the local tracking branch HEAD points to */ static int lookup_head_remote_key(git_buf *remote_name, git_repository *repo) { diff -Nru libgit2-0.22.2/src/submodule.h libgit2-0.23.1/src/submodule.h --- libgit2-0.22.2/src/submodule.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/submodule.h 2015-08-03 18:07:35.000000000 +0000 @@ -99,23 +99,6 @@ git_oid wd_oid; }; -/** - * The git_submodule_cache stores known submodules along with timestamps, - * etc. about when they were loaded - */ -typedef struct { - git_repository *repo; - git_strmap *submodules; - git_mutex lock; - - /* cache invalidation data */ - git_oid head_id; - git_futils_filestamp index_stamp; - git_buf gitmodules_path; - git_futils_filestamp gitmodules_stamp; - git_futils_filestamp config_stamp; -} git_submodule_cache; - /* Force revalidation of submodule data cache (alloc as needed) */ extern int git_submodule_cache_refresh(git_repository *repo); @@ -137,9 +120,6 @@ #define GIT_SUBMODULE_STATUS__CLEAR_INTERNAL(S) \ ((S) & ~(0xFFFFFFFFu << 20)) -/* Internal submodule check does not attempt to refresh cached data */ -extern bool git_submodule__is_submodule(git_repository *repo, const char *name); - /* Internal lookup does not attempt to refresh cached data */ extern int git_submodule__lookup( git_submodule **out, git_repository *repo, const char *path); @@ -163,8 +143,4 @@ extern int git_submodule_parse_update( git_submodule_update_t *out, const char *value); -extern const char *git_submodule_ignore_to_str(git_submodule_ignore_t); -extern const char *git_submodule_update_to_str(git_submodule_update_t); -extern const char *git_submodule_recurse_to_str(git_submodule_recurse_t); - #endif diff -Nru libgit2-0.22.2/src/tag.c libgit2-0.23.1/src/tag.c --- libgit2-0.22.2/src/tag.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/tag.c 2015-08-03 18:07:35.000000000 +0000 @@ -72,7 +72,7 @@ }; unsigned int i; - size_t text_len; + size_t text_len, alloc_len; char *search; if (git_oid__parse(&tag->target, &buffer, buffer_end, "object ") < 0) @@ -117,7 +117,8 @@ text_len = search - buffer; - tag->tag_name = git__malloc(text_len + 1); + GITERR_CHECK_ALLOC_ADD(&alloc_len, text_len, 1); + tag->tag_name = git__malloc(alloc_len); GITERR_CHECK_ALLOC(tag->tag_name); memcpy(tag->tag_name, buffer, text_len); @@ -141,7 +142,8 @@ text_len = buffer_end - ++buffer; - tag->message = git__malloc(text_len + 1); + GITERR_CHECK_ALLOC_ADD(&alloc_len, text_len, 1); + tag->message = git__malloc(alloc_len); GITERR_CHECK_ALLOC(tag->message); memcpy(tag->message, buffer, text_len); @@ -271,7 +273,7 @@ } else git_oid_cpy(oid, git_object_id(target)); - error = git_reference_create(&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite, NULL, NULL); + error = git_reference_create(&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite, NULL); cleanup: git_reference_free(new_ref); @@ -378,7 +380,7 @@ } error = git_reference_create( - &new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite, NULL, NULL); + &new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite, NULL); git_reference_free(new_ref); git_buf_free(&ref_name); diff -Nru libgit2-0.22.2/src/thread-utils.c libgit2-0.23.1/src/thread-utils.c --- libgit2-0.22.2/src/thread-utils.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/thread-utils.c 2015-08-03 18:07:35.000000000 +0000 @@ -8,7 +8,9 @@ #include "thread-utils.h" #ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # include #elif defined(hpux) || defined(__hpux) || defined(_hpux) # include diff -Nru libgit2-0.22.2/src/tls_stream.c libgit2-0.23.1/src/tls_stream.c --- libgit2-0.22.2/src/tls_stream.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/tls_stream.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#include "git2/errors.h" +#include "common.h" + +#include "openssl_stream.h" +#include "stransport_stream.h" + +int git_tls_stream_new(git_stream **out, const char *host, const char *port) +{ +#ifdef GIT_SECURE_TRANSPORT + return git_stransport_stream_new(out, host, port); +#elif defined(GIT_OPENSSL) + return git_openssl_stream_new(out, host, port); +#else + GIT_UNUSED(out); + GIT_UNUSED(host); + GIT_UNUSED(port); + + giterr_set(GITERR_SSL, "there is no TLS stream available"); + return -1; +#endif +} diff -Nru libgit2-0.22.2/src/tls_stream.h libgit2-0.23.1/src/tls_stream.h --- libgit2-0.22.2/src/tls_stream.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/tls_stream.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,21 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_tls_stream_h__ +#define INCLUDE_tls_stream_h__ + +#include "git2/sys/stream.h" + +/** + * Create a TLS stream with the most appropriate backend available for + * the current platform. + * + * This allows us to ask for a SecureTransport or OpenSSL stream + * according to being on general Unix vs OS X. + */ +extern int git_tls_stream_new(git_stream **out, const char *host, const char *port); + +#endif diff -Nru libgit2-0.22.2/src/transaction.c libgit2-0.23.1/src/transaction.c --- libgit2-0.22.2/src/transaction.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transaction.c 2015-08-03 18:07:35.000000000 +0000 @@ -13,11 +13,12 @@ #include "reflog.h" #include "signature.h" +#include "git2/transaction.h" #include "git2/signature.h" #include "git2/sys/refs.h" #include "git2/sys/refdb_backend.h" -GIT__USE_STRMAP; +GIT__USE_STRMAP typedef struct { const char *name; diff -Nru libgit2-0.22.2/src/transport.c libgit2-0.23.1/src/transport.c --- libgit2-0.22.2/src/transport.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transport.c 2015-08-03 18:07:35.000000000 +0000 @@ -18,10 +18,10 @@ void *param; } transport_definition; -static git_smart_subtransport_definition http_subtransport_definition = { git_smart_subtransport_http, 1 }; -static git_smart_subtransport_definition git_subtransport_definition = { git_smart_subtransport_git, 0 }; +static git_smart_subtransport_definition http_subtransport_definition = { git_smart_subtransport_http, 1, NULL }; +static git_smart_subtransport_definition git_subtransport_definition = { git_smart_subtransport_git, 0, NULL }; #ifdef GIT_SSH -static git_smart_subtransport_definition ssh_subtransport_definition = { git_smart_subtransport_ssh, 0 }; +static git_smart_subtransport_definition ssh_subtransport_definition = { git_smart_subtransport_ssh, 0, NULL }; #endif static transport_definition local_transport_definition = { "file://", git_transport_local, NULL }; @@ -29,7 +29,7 @@ static transport_definition transports[] = { { "git://", git_transport_smart, &git_subtransport_definition }, { "http://", git_transport_smart, &http_subtransport_definition }, -#if defined(GIT_SSL) || defined(GIT_WINHTTP) +#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) { "https://", git_transport_smart, &http_subtransport_definition }, #endif { "file://", git_transport_local, NULL }, diff -Nru libgit2-0.22.2/src/transports/cred.c libgit2-0.23.1/src/transports/cred.c --- libgit2-0.22.2/src/transports/cred.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/cred.c 2015-08-03 18:07:35.000000000 +0000 @@ -9,6 +9,14 @@ #include "smart.h" #include "git2/cred_helpers.h" +static int git_cred_ssh_key_type_new( + git_cred **cred, + const char *username, + const char *publickey, + const char *privatekey, + const char *passphrase, + git_credtype_t credtype); + int git_cred_has_username(git_cred *cred) { if (cred->credtype == GIT_CREDTYPE_DEFAULT) @@ -31,6 +39,7 @@ return c->username; } case GIT_CREDTYPE_SSH_KEY: + case GIT_CREDTYPE_SSH_MEMORY: { git_cred_ssh_key *c = (git_cred_ssh_key *) cred; return c->username; @@ -175,6 +184,51 @@ const char *privatekey, const char *passphrase) { + return git_cred_ssh_key_type_new( + cred, + username, + publickey, + privatekey, + passphrase, + GIT_CREDTYPE_SSH_KEY); +} + +int git_cred_ssh_key_memory_new( + git_cred **cred, + const char *username, + const char *publickey, + const char *privatekey, + const char *passphrase) +{ +#ifdef GIT_SSH_MEMORY_CREDENTIALS + return git_cred_ssh_key_type_new( + cred, + username, + publickey, + privatekey, + passphrase, + GIT_CREDTYPE_SSH_MEMORY); +#else + GIT_UNUSED(cred); + GIT_UNUSED(username); + GIT_UNUSED(publickey); + GIT_UNUSED(privatekey); + GIT_UNUSED(passphrase); + + giterr_set(GITERR_INVALID, + "This version of libgit2 was not built with ssh memory credentials."); + return -1; +#endif +} + +static int git_cred_ssh_key_type_new( + git_cred **cred, + const char *username, + const char *publickey, + const char *privatekey, + const char *passphrase, + git_credtype_t credtype) +{ git_cred_ssh_key *c; assert(username && cred && privatekey); @@ -182,7 +236,7 @@ c = git__calloc(1, sizeof(git_cred_ssh_key)); GITERR_CHECK_ALLOC(c); - c->parent.credtype = GIT_CREDTYPE_SSH_KEY; + c->parent.credtype = credtype; c->parent.free = ssh_key_free; c->username = git__strdup(username); @@ -306,12 +360,15 @@ int git_cred_username_new(git_cred **cred, const char *username) { git_cred_username *c; - size_t len; + size_t len, allocsize; assert(cred); len = strlen(username); - c = git__malloc(sizeof(git_cred_username) + len + 1); + + GITERR_CHECK_ALLOC_ADD(&allocsize, sizeof(git_cred_username), len); + GITERR_CHECK_ALLOC_ADD(&allocsize, allocsize, 1); + c = git__malloc(allocsize); GITERR_CHECK_ALLOC(c); c->parent.credtype = GIT_CREDTYPE_USERNAME; diff -Nru libgit2-0.22.2/src/transports/git.c libgit2-0.23.1/src/transports/git.c --- libgit2-0.22.2/src/transports/git.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/git.c 2015-08-03 18:07:35.000000000 +0000 @@ -50,6 +50,8 @@ } repo = delim; + if (repo[1] == '~') + ++repo; delim = strchr(url, ':'); if (delim == NULL) @@ -155,7 +157,7 @@ if (!stream) return -1; - s = git__calloc(sizeof(git_proto_stream), 1); + s = git__calloc(1, sizeof(git_proto_stream)); GITERR_CHECK_ALLOC(s); s->parent.subtransport = &t->parent; @@ -341,14 +343,16 @@ git__free(t); } -int git_smart_subtransport_git(git_smart_subtransport **out, git_transport *owner) +int git_smart_subtransport_git(git_smart_subtransport **out, git_transport *owner, void *param) { git_subtransport *t; + GIT_UNUSED(param); + if (!out) return -1; - t = git__calloc(sizeof(git_subtransport), 1); + t = git__calloc(1, sizeof(git_subtransport)); GITERR_CHECK_ALLOC(t); t->owner = owner; diff -Nru libgit2-0.22.2/src/transports/http.c libgit2-0.23.1/src/transports/http.c --- libgit2-0.22.2/src/transports/http.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/http.c 2015-08-03 18:07:35.000000000 +0000 @@ -10,11 +10,13 @@ #include "http_parser.h" #include "buffer.h" #include "netops.h" +#include "remote.h" #include "smart.h" #include "auth.h" #include "auth_negotiate.h" -#include "openssl_stream.h" +#include "tls_stream.h" #include "socket_stream.h" +#include "curl_stream.h" git_http_auth_scheme auth_schemes[] = { { GIT_AUTHTYPE_NEGOTIATE, "Negotiate", GIT_CREDTYPE_DEFAULT, git_http_auth_negotiate }, @@ -70,7 +72,7 @@ gitno_buffer parse_buffer; git_buf parse_header_name; git_buf parse_header_value; - char parse_buffer_data[2048]; + char parse_buffer_data[NETIO_BUFSIZE]; char *content_type; char *location; git_vector www_authenticate; @@ -253,7 +255,7 @@ GITERR_CHECK_ALLOC(t->content_type); } } - else if (!strcmp("WWW-Authenticate", git_buf_cstr(name))) { + else if (!strcasecmp("WWW-Authenticate", git_buf_cstr(name))) { char *dup = git__strdup(git_buf_cstr(value)); GITERR_CHECK_ALLOC(dup); @@ -334,8 +336,11 @@ if (!t->owner->cred_acquire_cb) { no_callback = 1; } else { - if (allowed_auth_types && - (!t->cred || 0 == (t->cred->credtype & allowed_auth_types))) { + if (allowed_auth_types) { + if (t->cred) { + t->cred->free(t->cred); + t->cred = NULL; + } error = t->owner->cred_acquire_cb(&t->cred, t->owner->url, @@ -506,7 +511,7 @@ git_buf buf = GIT_BUF_INIT; /* Chunk header */ - git_buf_printf(&buf, "%X\r\n", (unsigned)len); + git_buf_printf(&buf, "%" PRIxZ "\r\n", len); if (git_buf_oom(&buf)) return -1; @@ -532,6 +537,7 @@ static int http_connect(http_subtransport *t) { int error; + char *proxy_url; if (t->connected && http_should_keep_alive(&t->parser) && @@ -545,9 +551,13 @@ } if (t->connection_data.use_ssl) { - error = git_openssl_stream_new(&t->io, t->connection_data.host, t->connection_data.port); + error = git_tls_stream_new(&t->io, t->connection_data.host, t->connection_data.port); } else { +#ifdef GIT_CURL + error = git_curl_stream_new(&t->io, t->connection_data.host, t->connection_data.port); +#else error = git_socket_stream_new(&t->io, t->connection_data.host, t->connection_data.port); +#endif } if (error < 0) @@ -555,9 +565,18 @@ GITERR_CHECK_VERSION(t->io, GIT_STREAM_VERSION, "git_stream"); + if (git_stream_supports_proxy(t->io) && + !git_remote__get_http_proxy(t->owner->owner, !!t->connection_data.use_ssl, &proxy_url)) { + error = git_stream_set_proxy(t->io, proxy_url); + git__free(proxy_url); + + if (error < 0) + return error; + } + error = git_stream_connect(t->io); -#ifdef GIT_SSL +#if defined(GIT_OPENSSL) || defined(GIT_SECURE_TRANSPORT) || defined(GIT_CURL) if ((!error || error == GIT_ECERTIFICATE) && t->owner->certificate_check_cb != NULL && git_stream_is_encrypted(t->io)) { git_cert *cert; @@ -1008,10 +1027,12 @@ git__free(t); } -int git_smart_subtransport_http(git_smart_subtransport **out, git_transport *owner) +int git_smart_subtransport_http(git_smart_subtransport **out, git_transport *owner, void *param) { http_subtransport *t; + GIT_UNUSED(param); + if (!out) return -1; diff -Nru libgit2-0.22.2/src/transports/local.c libgit2-0.23.1/src/transports/local.c --- libgit2-0.22.2/src/transports/local.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/local.c 2015-08-03 18:07:35.000000000 +0000 @@ -16,7 +16,6 @@ #include "git2/pack.h" #include "git2/commit.h" #include "git2/revparse.h" -#include "git2/push.h" #include "pack-objects.h" #include "refs.h" #include "posix.h" @@ -290,50 +289,6 @@ return 0; } -static int local_push_copy_object( - git_odb *local_odb, - git_odb *remote_odb, - git_pobject *obj) -{ - int error = 0; - git_odb_object *odb_obj = NULL; - git_odb_stream *odb_stream; - size_t odb_obj_size; - git_otype odb_obj_type; - git_oid remote_odb_obj_oid; - - /* Object already exists in the remote ODB; do nothing and return 0*/ - if (git_odb_exists(remote_odb, &obj->id)) - return 0; - - if ((error = git_odb_read(&odb_obj, local_odb, &obj->id)) < 0) - return error; - - odb_obj_size = git_odb_object_size(odb_obj); - odb_obj_type = git_odb_object_type(odb_obj); - - if ((error = git_odb_open_wstream(&odb_stream, remote_odb, - odb_obj_size, odb_obj_type)) < 0) - goto on_error; - - if (git_odb_stream_write(odb_stream, (char *)git_odb_object_data(odb_obj), - odb_obj_size) < 0 || - git_odb_stream_finalize_write(&remote_odb_obj_oid, odb_stream) < 0) { - error = -1; - } else if (git_oid__cmp(&obj->id, &remote_odb_obj_oid) != 0) { - giterr_set(GITERR_ODB, "Error when writing object to remote odb " - "during local push operation. Remote odb object oid does not " - "match local oid."); - error = -1; - } - - git_odb_stream_free(odb_stream); - -on_error: - git_odb_object_free(odb_obj); - return error; -} - static int local_push_update_remote_ref( git_repository *remote_repo, const char *lref, @@ -348,7 +303,7 @@ if (lref[0] != '\0') { /* Create or update a ref */ error = git_reference_create(NULL, remote_repo, rref, loid, - !git_oid_iszero(roid), NULL, NULL); + !git_oid_iszero(roid), NULL); } else { /* Delete a ref */ if ((error = git_reference_lookup(&remote_ref, remote_repo, rref)) < 0) { @@ -364,22 +319,33 @@ return error; } +static int transfer_to_push_transfer(const git_transfer_progress *stats, void *payload) +{ + const git_remote_callbacks *cbs = payload; + + if (!cbs || !cbs->push_transfer_progress) + return 0; + + return cbs->push_transfer_progress(stats->received_objects, stats->total_objects, stats->received_bytes, + cbs->payload); +} + static int local_push( git_transport *transport, - git_push *push) + git_push *push, + const git_remote_callbacks *cbs) { transport_local *t = (transport_local *)transport; - git_odb *remote_odb = NULL; - git_odb *local_odb = NULL; git_repository *remote_repo = NULL; push_spec *spec; char *url = NULL; const char *path; - git_buf buf = GIT_BUF_INIT; + git_buf buf = GIT_BUF_INIT, odb_path = GIT_BUF_INIT; int error; - unsigned int i; size_t j; + GIT_UNUSED(cbs); + /* 'push->remote->url' may be a url or path; convert to a path */ if ((error = git_path_from_url_or_path(&buf, push->remote->url)) < 0) { git_buf_free(&buf); @@ -396,22 +362,24 @@ /* We don't currently support pushing locally to non-bare repos. Proper non-bare repo push support would require checking configs to see if - we should override the default 'don't let this happen' behavior */ + we should override the default 'don't let this happen' behavior. + + Note that this is only an issue when pushing to the current branch, + but we forbid all pushes just in case */ if (!remote_repo->is_bare) { error = GIT_EBAREREPO; giterr_set(GITERR_INVALID, "Local push doesn't (yet) support pushing to non-bare repos."); goto on_error; } - if ((error = git_repository_odb__weakptr(&remote_odb, remote_repo)) < 0 || - (error = git_repository_odb__weakptr(&local_odb, push->repo)) < 0) + if ((error = git_buf_joinpath(&odb_path, git_repository_path(remote_repo), "objects/pack")) < 0) goto on_error; - for (i = 0; i < push->pb->nr_objects; i++) { - if ((error = local_push_copy_object(local_odb, remote_odb, - &push->pb->object_list[i])) < 0) - goto on_error; - } + error = git_packbuilder_write(push->pb, odb_path.ptr, 0, transfer_to_push_transfer, (void *) cbs); + git_buf_free(&odb_path); + + if (error < 0) + goto on_error; push->unpack_ok = 1; @@ -420,7 +388,7 @@ const git_error *last; char *ref = spec->refspec.dst; - status = git__calloc(sizeof(push_status), 1); + status = git__calloc(1, sizeof(push_status)); if (!status) goto on_error; @@ -471,7 +439,7 @@ if (!url || t->parent.close(&t->parent) < 0 || t->parent.connect(&t->parent, url, - push->remote->callbacks.credentials, NULL, GIT_DIRECTION_PUSH, flags)) + NULL, NULL, GIT_DIRECTION_PUSH, flags)) goto on_error; } @@ -500,6 +468,37 @@ } static const char *counting_objects_fmt = "Counting objects %d\r"; +static const char *compressing_objects_fmt = "Compressing objects: %.0f%% (%d/%d)"; + +static int local_counting(int stage, unsigned int current, unsigned int total, void *payload) +{ + git_buf progress_info = GIT_BUF_INIT; + transport_local *t = payload; + int error; + + if (!t->progress_cb) + return 0; + + if (stage == GIT_PACKBUILDER_ADDING_OBJECTS) { + git_buf_printf(&progress_info, counting_objects_fmt, current); + } else if (stage == GIT_PACKBUILDER_DELTAFICATION) { + float perc = (((float) current) / total) * 100; + git_buf_printf(&progress_info, compressing_objects_fmt, perc, current, total); + if (current == total) + git_buf_printf(&progress_info, ", done\n"); + else + git_buf_putc(&progress_info, '\r'); + + } + + if (git_buf_oom(&progress_info)) + return -1; + + error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload); + git_buf_free(&progress_info); + + return error; +} static int local_download_pack( git_transport *transport, @@ -513,7 +512,6 @@ git_remote_head *rhead; unsigned int i; int error = -1; - git_oid oid; git_packbuilder *pack = NULL; git_odb_writepack *writepack = NULL; git_odb *odb = NULL; @@ -526,6 +524,8 @@ if ((error = git_packbuilder_new(&pack, t->repo)) < 0) goto cleanup; + git_packbuilder_set_callbacks(pack, local_counting, t); + stats->total_objects = 0; stats->indexed_objects = 0; stats->received_objects = 0; @@ -539,15 +539,23 @@ if (git_object_type(obj) == GIT_OBJ_COMMIT) { /* Revwalker includes only wanted commits */ error = git_revwalk_push(walk, &rhead->oid); - if (!git_oid_iszero(&rhead->loid)) + if (!error && !git_oid_iszero(&rhead->loid)) { error = git_revwalk_hide(walk, &rhead->loid); + if (error == GIT_ENOTFOUND) + error = 0; + } } else { /* Tag or some other wanted object. Add it on its own */ - error = git_packbuilder_insert(pack, &rhead->oid, rhead->name); + error = git_packbuilder_insert_recur(pack, &rhead->oid, rhead->name); } git_object_free(obj); + if (error < 0) + goto cleanup; } + if ((error = git_packbuilder_insert_walk(pack, walk))) + goto cleanup; + if ((error = git_buf_printf(&progress_info, counting_objects_fmt, git_packbuilder_object_count(pack))) < 0) goto cleanup; @@ -559,35 +567,6 @@ if ((error = git_repository_odb__weakptr(&odb, repo)) < 0) goto cleanup; - while ((error = git_revwalk_next(&oid, walk)) == 0) { - git_commit *commit; - - /* Skip commits we already have */ - if (git_odb_exists(odb, &oid)) continue; - - if (!git_object_lookup((git_object**)&commit, t->repo, &oid, GIT_OBJ_COMMIT)) { - const git_oid *tree_oid = git_commit_tree_id(commit); - - /* Add the commit and its tree */ - if ((error = git_packbuilder_insert(pack, &oid, NULL)) < 0 || - (error = git_packbuilder_insert_tree(pack, tree_oid)) < 0) { - git_commit_free(commit); - goto cleanup; - } - - git_commit_free(commit); - - git_buf_clear(&progress_info); - if ((error = git_buf_printf(&progress_info, counting_objects_fmt, git_packbuilder_object_count(pack))) < 0) - goto cleanup; - - if (t->progress_cb && - (error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload)) < 0) - goto cleanup; - - } - } - /* One last one with the newline */ git_buf_clear(&progress_info); git_buf_printf(&progress_info, counting_objects_fmt, git_packbuilder_object_count(pack)); @@ -609,9 +588,13 @@ data.progress_payload = progress_payload; data.writepack = writepack; + /* autodetect */ + git_packbuilder_set_threads(pack, 0); + if ((error = git_packbuilder_foreach(pack, foreach_cb, &data)) != 0) goto cleanup; } + error = writepack->commit(writepack, stats); cleanup: diff -Nru libgit2-0.22.2/src/transports/smart.c libgit2-0.23.1/src/transports/smart.c --- libgit2-0.22.2/src/transports/smart.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/smart.c 2015-08-03 18:07:35.000000000 +0000 @@ -380,7 +380,7 @@ if (!param) return -1; - t = git__calloc(sizeof(transport_smart), 1); + t = git__calloc(1, sizeof(transport_smart)); GITERR_CHECK_ALLOC(t); t->parent.version = GIT_TRANSPORT_VERSION; @@ -409,7 +409,7 @@ return -1; } - if (definition->callback(&t->wrapped, &t->parent) < 0) { + if (definition->callback(&t->wrapped, &t->parent, definition->param) < 0) { git__free(t); return -1; } diff -Nru libgit2-0.22.2/src/transports/smart.h libgit2-0.23.1/src/transports/smart.h --- libgit2-0.22.2/src/transports/smart.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/smart.h 2015-08-03 18:07:35.000000000 +0000 @@ -158,7 +158,7 @@ /* smart_protocol.c */ int git_smart__store_refs(transport_smart *t, int flushes); int git_smart__detect_caps(git_pkt_ref *pkt, transport_smart_caps *caps, git_vector *symrefs); -int git_smart__push(git_transport *transport, git_push *push); +int git_smart__push(git_transport *transport, git_push *push, const git_remote_callbacks *cbs); int git_smart__negotiate_fetch( git_transport *transport, diff -Nru libgit2-0.22.2/src/transports/smart_pkt.c libgit2-0.23.1/src/transports/smart_pkt.c --- libgit2-0.22.2/src/transports/smart_pkt.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/smart_pkt.c 2015-08-03 18:07:35.000000000 +0000 @@ -102,8 +102,11 @@ static int comment_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_comment *pkt; + size_t alloclen; - pkt = git__malloc(sizeof(git_pkt_comment) + len + 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_pkt_comment), len); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + pkt = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_COMMENT; @@ -118,11 +121,15 @@ static int err_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_err *pkt; + size_t alloclen; /* Remove "ERR " from the line */ line += 4; len -= 4; - pkt = git__malloc(sizeof(git_pkt_err) + len + 1); + + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_pkt_progress), len); + GITERR_CHECK_ALLOC_ADD(&alloclen, alloclen, 1); + pkt = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_ERR; @@ -138,10 +145,13 @@ static int data_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_data *pkt; + size_t alloclen; line++; len--; - pkt = git__malloc(sizeof(git_pkt_data) + len); + + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_pkt_progress), len); + pkt = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_DATA; @@ -156,10 +166,13 @@ static int sideband_progress_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_progress *pkt; + size_t alloclen; line++; len--; - pkt = git__malloc(sizeof(git_pkt_progress) + len); + + GITERR_CHECK_ALLOC_ADD(&alloclen, sizeof(git_pkt_progress), len); + pkt = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_PROGRESS; @@ -174,10 +187,14 @@ static int sideband_error_pkt(git_pkt **out, const char *line, size_t len) { git_pkt_err *pkt; + size_t alloc_len; line++; len--; - pkt = git__malloc(sizeof(git_pkt_err) + len + 1); + + GITERR_CHECK_ALLOC_ADD(&alloc_len, sizeof(git_pkt_err), len); + GITERR_CHECK_ALLOC_ADD(&alloc_len, alloc_len, 1); + pkt = git__malloc(alloc_len); GITERR_CHECK_ALLOC(pkt); pkt->type = GIT_PKT_ERR; @@ -197,6 +214,7 @@ { int error; git_pkt_ref *pkt; + size_t alloclen; pkt = git__malloc(sizeof(git_pkt_ref)); GITERR_CHECK_ALLOC(pkt); @@ -220,7 +238,8 @@ if (line[len - 1] == '\n') --len; - pkt->head.name = git__malloc(len + 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1); + pkt->head.name = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt->head.name); memcpy(pkt->head.name, line, len); @@ -242,6 +261,7 @@ { git_pkt_ok *pkt; const char *ptr; + size_t alloc_len; pkt = git__malloc(sizeof(*pkt)); GITERR_CHECK_ALLOC(pkt); @@ -249,10 +269,14 @@ pkt->type = GIT_PKT_OK; line += 3; /* skip "ok " */ - ptr = strchr(line, '\n'); + if (!(ptr = strchr(line, '\n'))) { + giterr_set(GITERR_NET, "Invalid packet line"); + return -1; + } len = ptr - line; - pkt->ref = git__malloc(len + 1); + GITERR_CHECK_ALLOC_ADD(&alloc_len, len, 1); + pkt->ref = git__malloc(alloc_len); GITERR_CHECK_ALLOC(pkt->ref); memcpy(pkt->ref, line, len); @@ -266,6 +290,7 @@ { git_pkt_ng *pkt; const char *ptr; + size_t alloclen; pkt = git__malloc(sizeof(*pkt)); GITERR_CHECK_ALLOC(pkt); @@ -273,20 +298,28 @@ pkt->type = GIT_PKT_NG; line += 3; /* skip "ng " */ - ptr = strchr(line, ' '); + if (!(ptr = strchr(line, ' '))) { + giterr_set(GITERR_NET, "Invalid packet line"); + return -1; + } len = ptr - line; - pkt->ref = git__malloc(len + 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1); + pkt->ref = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt->ref); memcpy(pkt->ref, line, len); pkt->ref[len] = '\0'; line = ptr + 1; - ptr = strchr(line, '\n'); + if (!(ptr = strchr(line, '\n'))) { + giterr_set(GITERR_NET, "Invalid packet line"); + return -1; + } len = ptr - line; - pkt->msg = git__malloc(len + 1); + GITERR_CHECK_ALLOC_ADD(&alloclen, len, 1); + pkt->msg = git__malloc(alloclen); GITERR_CHECK_ALLOC(pkt->msg); memcpy(pkt->msg, line, len); @@ -459,7 +492,7 @@ { git_buf str = GIT_BUF_INIT; char oid[GIT_OID_HEXSZ +1] = {0}; - unsigned int len; + size_t len; /* Prefer multi_ack_detailed */ if (caps->multi_ack_detailed) @@ -485,12 +518,19 @@ if (git_buf_oom(&str)) return -1; - len = (unsigned int) - (strlen("XXXXwant ") + GIT_OID_HEXSZ + 1 /* NUL */ + - git_buf_len(&str) + 1 /* LF */); - git_buf_grow(buf, git_buf_len(buf) + len); + len = strlen("XXXXwant ") + GIT_OID_HEXSZ + 1 /* NUL */ + + git_buf_len(&str) + 1 /* LF */; + + if (len > 0xffff) { + giterr_set(GITERR_NET, + "Tried to produce packet with invalid length %" PRIuZ, len); + return -1; + } + + git_buf_grow_by(buf, len); git_oid_fmt(oid, &head->oid); - git_buf_printf(buf, "%04xwant %s %s\n", len, oid, git_buf_cstr(&str)); + git_buf_printf(buf, + "%04xwant %s %s\n", (unsigned int)len, oid, git_buf_cstr(&str)); git_buf_free(&str); return git_buf_oom(buf); diff -Nru libgit2-0.22.2/src/transports/smart_protocol.c libgit2-0.23.1/src/transports/smart_protocol.c --- libgit2-0.22.2/src/transports/smart_protocol.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/smart_protocol.c 2015-08-03 18:07:35.000000000 +0000 @@ -51,8 +51,8 @@ return recvd; if (recvd == 0 && !flush) { - giterr_set(GITERR_NET, "Early EOF"); - return -1; + giterr_set(GITERR_NET, "early EOF"); + return GIT_EEOF; } continue; @@ -685,7 +685,7 @@ switch (pkt->type) { case GIT_PKT_OK: - status = git__calloc(sizeof(push_status), 1); + status = git__calloc(1, sizeof(push_status)); GITERR_CHECK_ALLOC(status); status->msg = NULL; status->ref = git__strdup(((git_pkt_ok *)pkt)->ref); @@ -696,7 +696,7 @@ } break; case GIT_PKT_NG: - status = git__calloc(sizeof(push_status), 1); + status = git__calloc(1, sizeof(push_status)); GITERR_CHECK_ALLOC(status); status->ref = git__strdup(((git_pkt_ng *)pkt)->ref); status->msg = git__strdup(((git_pkt_ng *)pkt)->msg); @@ -769,8 +769,8 @@ return recvd; if (recvd == 0) { - giterr_set(GITERR_NET, "Early EOF"); - return -1; + giterr_set(GITERR_NET, "early EOF"); + return GIT_EEOF; } continue; } @@ -946,7 +946,7 @@ return error; } -int git_smart__push(git_transport *transport, git_push *push) +int git_smart__push(git_transport *transport, git_push *push, const git_remote_callbacks *cbs) { transport_smart *t = (transport_smart *)transport; struct push_packbuilder_payload packbuilder_payload = {0}; @@ -957,9 +957,9 @@ packbuilder_payload.pb = push->pb; - if (push->transfer_progress_cb) { - packbuilder_payload.cb = push->transfer_progress_cb; - packbuilder_payload.cb_payload = push->transfer_progress_cb_payload; + if (cbs && cbs->transfer_progress) { + packbuilder_payload.cb = cbs->push_transfer_progress; + packbuilder_payload.cb_payload = cbs->payload; } #ifdef PUSH_DEBUG @@ -1010,12 +1010,12 @@ goto done; /* If progress is being reported write the final report */ - if (push->transfer_progress_cb) { - error = push->transfer_progress_cb( + if (cbs && cbs->push_transfer_progress) { + error = cbs->push_transfer_progress( push->pb->nr_written, push->pb->nr_objects, packbuilder_payload.last_bytes, - push->transfer_progress_cb_payload); + cbs->payload); if (error < 0) goto done; diff -Nru libgit2-0.22.2/src/transports/ssh.c libgit2-0.23.1/src/transports/ssh.c --- libgit2-0.22.2/src/transports/ssh.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/ssh.c 2015-08-03 18:07:35.000000000 +0000 @@ -66,6 +66,8 @@ if (!git__prefixcmp(url, prefix_ssh)) { url = url + strlen(prefix_ssh); repo = strchr(url, '/'); + if (repo && repo[1] == '~') + ++repo; } else { repo = strchr(url, ':'); if (repo) repo++; @@ -125,10 +127,21 @@ return -1; if ((rc = libssh2_channel_read(s->channel, buffer, buf_size)) < LIBSSH2_ERROR_NONE) { - ssh_error(s->session, "SSH could not read data");; + ssh_error(s->session, "SSH could not read data"); return -1; } + /* + * If we can't get anything out of stdout, it's typically a + * not-found error, so read from stderr and signal EOF on + * stderr. + */ + if (rc == 0 && (rc = libssh2_channel_read_stderr(s->channel, buffer, buf_size)) > 0) { + giterr_set(GITERR_SSH, "%*s", rc, buffer); + return GIT_EEOF; + } + + *bytes_read = rc; return 0; @@ -166,11 +179,12 @@ static void ssh_stream_free(git_smart_subtransport_stream *stream) { ssh_stream *s = (ssh_stream *)stream; - ssh_subtransport *t = OWNING_SUBTRANSPORT(s); - int ret; + ssh_subtransport *t; - GIT_UNUSED(ret); + if (!stream) + return; + t = OWNING_SUBTRANSPORT(s); t->current_stream = NULL; if (s->channel) { @@ -282,8 +296,14 @@ if (rc < 0) goto shutdown; - if (rc == 1) + /* rc is set to 1 whenever the ssh agent ran out of keys to check. + * Set the error code to authentication failure rather than erroring + * out with an untranslatable error code. + */ + if (rc == 1) { + rc = LIBSSH2_ERROR_AUTHENTICATION_FAILED; goto shutdown; + } rc = libssh2_agent_userauth(agent, c->username, curr); @@ -359,6 +379,25 @@ session, c->username, c->prompt_callback); break; } +#ifdef GIT_SSH_MEMORY_CREDENTIALS + case GIT_CREDTYPE_SSH_MEMORY: { + git_cred_ssh_key *c = (git_cred_ssh_key *)cred; + + assert(c->username); + assert(c->privatekey); + + rc = libssh2_userauth_publickey_frommemory( + session, + c->username, + strlen(c->username), + c->publickey, + c->publickey ? strlen(c->publickey) : 0, + c->privatekey, + strlen(c->privatekey), + c->passphrase); + break; + } +#endif default: rc = LIBSSH2_ERROR_AUTHENTICATION_FAILED; } @@ -585,8 +624,7 @@ done: if (error < 0) { - if (*stream) - ssh_stream_free(*stream); + ssh_stream_free(*stream); if (session) libssh2_session_free(session); @@ -729,6 +767,9 @@ if (!git__prefixcmp(ptr, SSH_AUTH_PUBLICKEY)) { *out |= GIT_CREDTYPE_SSH_KEY; *out |= GIT_CREDTYPE_SSH_CUSTOM; +#ifdef GIT_SSH_MEMORY_CREDENTIALS + *out |= GIT_CREDTYPE_SSH_MEMORY; +#endif ptr += strlen(SSH_AUTH_PUBLICKEY); continue; } @@ -754,13 +795,15 @@ #endif int git_smart_subtransport_ssh( - git_smart_subtransport **out, git_transport *owner) + git_smart_subtransport **out, git_transport *owner, void *param) { #ifdef GIT_SSH ssh_subtransport *t; assert(out); + GIT_UNUSED(param); + t = git__calloc(sizeof(ssh_subtransport), 1); GITERR_CHECK_ALLOC(t); @@ -773,6 +816,7 @@ return 0; #else GIT_UNUSED(owner); + GIT_UNUSED(param); assert(out); *out = NULL; @@ -793,6 +837,7 @@ git_smart_subtransport_definition ssh_definition = { git_smart_subtransport_ssh, 0, /* no RPC */ + NULL, }; if (paths->count != 2) { diff -Nru libgit2-0.22.2/src/transports/winhttp.c libgit2-0.23.1/src/transports/winhttp.c --- libgit2-0.22.2/src/transports/winhttp.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/transports/winhttp.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,19 +17,12 @@ #include "repository.h" #include -#pragma comment(lib, "crypt32") #include -#pragma comment(lib, "winhttp") - -#include /* For IInternetSecurityManager zone check */ #include #include -/* For UuidCreate */ -#pragma comment(lib, "rpcrt4") - #define WIDEN2(s) L ## s #define WIDEN(s) WIDEN2(s) @@ -43,7 +36,6 @@ #define WINHTTP_IGNORE_REQUEST_TOTAL_LENGTH 0 #endif -static const char *prefix_http = "http://"; static const char *prefix_https = "https://"; static const char *upload_pack_service = "upload-pack"; static const char *upload_pack_ls_service_url = "/info/refs?service=git-upload-pack"; @@ -59,6 +51,13 @@ SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_UNKNOWN_CA; +#if defined(__MINGW32__) +const CLSID CLSID_InternetSecurityManager = { 0x7B8A2D94, 0x0AC9, 0x11D1, + { 0x89, 0x6C, 0x00, 0xC0, 0x4F, 0xB6, 0xBF, 0xC4 } }; +const IID IID_IInternetSecurityManager = { 0x79EAC9EE, 0xBAF9, 0x11CE, + { 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9, 0x0B } }; +#endif + #define OWNING_SUBTRANSPORT(s) ((winhttp_subtransport *)(s)->parent.subtransport) typedef enum { @@ -272,7 +271,7 @@ git_buf buf = GIT_BUF_INIT; char *proxy_url = NULL; wchar_t ct[MAX_CONTENT_TYPE_LEN]; - wchar_t *types[] = { L"*/*", NULL }; + LPCWSTR types[] = { L"*/*", NULL }; BOOL peerdist = FALSE; int error = -1; unsigned long disable_redirects = WINHTTP_DISABLE_REDIRECTS; @@ -551,8 +550,7 @@ } static int winhttp_connect( - winhttp_subtransport *t, - const char *url) + winhttp_subtransport *t) { wchar_t *ua = L"git/1.0 (libgit2 " WIDEN(LIBGIT2_VERSION) L")"; wchar_t *wide_host; @@ -561,8 +559,6 @@ int default_timeout = TIMEOUT_INFINITE; int default_connect_timeout = DEFAULT_CONNECT_TIMEOUT; - GIT_UNUSED(url); - t->session = NULL; t->connection = NULL; @@ -860,7 +856,7 @@ winhttp_close_connection(t); - if (winhttp_connect(t, location8) < 0) + if (winhttp_connect(t) < 0) return -1; } @@ -963,7 +959,6 @@ size_t len) { winhttp_stream *s = (winhttp_stream *)stream; - winhttp_subtransport *t = OWNING_SUBTRANSPORT(s); DWORD bytes_written; int error; @@ -998,7 +993,7 @@ { UUID uuid; RPC_STATUS status = UuidCreate(&uuid); - HRESULT result; + int result; if (RPC_S_OK != status && RPC_S_UUID_LOCAL_ONLY != status && @@ -1012,14 +1007,17 @@ return -1; } - result = StringCbPrintfW( - buffer, buffer_len_cch, +#if !defined(__MINGW32__) || defined(MINGW_HAS_SECURE_API) + result = swprintf_s(buffer, buffer_len_cch, +#else + result = wsprintfW(buffer, +#endif L"%08x%04x%04x%02x%02x%02x%02x%02x%02x%02x%02x", uuid.Data1, uuid.Data2, uuid.Data3, uuid.Data4[0], uuid.Data4[1], uuid.Data4[2], uuid.Data4[3], uuid.Data4[4], uuid.Data4[5], uuid.Data4[6], uuid.Data4[7]); - if (FAILED(result)) { + if (result < UUID_LENGTH_CCH) { giterr_set(GITERR_OS, "Unable to generate name for temp file"); return -1; } @@ -1053,7 +1051,6 @@ size_t len) { winhttp_stream *s = (winhttp_stream *)stream; - winhttp_subtransport *t = OWNING_SUBTRANSPORT(s); DWORD bytes_written; if (!s->request && winhttp_stream_connect(s) < 0) @@ -1099,7 +1096,6 @@ size_t len) { winhttp_stream *s = (winhttp_stream *)stream; - winhttp_subtransport *t = OWNING_SUBTRANSPORT(s); int error; if (!s->request && winhttp_stream_connect(s) < 0) @@ -1135,7 +1131,7 @@ } else { /* Append as much to the buffer as we can */ - int count = min(CACHED_POST_BODY_BUF_SIZE - s->chunk_buffer_len, (int)len); + int count = (int)min(CACHED_POST_BODY_BUF_SIZE - s->chunk_buffer_len, len); if (!s->chunk_buffer) s->chunk_buffer = git__malloc(CACHED_POST_BODY_BUF_SIZE); @@ -1178,7 +1174,7 @@ if (!stream) return -1; - s = git__calloc(sizeof(winhttp_stream), 1); + s = git__calloc(1, sizeof(winhttp_stream)); GITERR_CHECK_ALLOC(s); s->parent.subtransport = &t->parent; @@ -1195,6 +1191,8 @@ winhttp_subtransport *t, winhttp_stream *s) { + GIT_UNUSED(t); + s->service = upload_pack_service; s->service_url = upload_pack_ls_service_url; s->verb = get_verb; @@ -1206,6 +1204,8 @@ winhttp_subtransport *t, winhttp_stream *s) { + GIT_UNUSED(t); + s->service = upload_pack_service; s->service_url = upload_pack_service_url; s->verb = post_verb; @@ -1217,6 +1217,8 @@ winhttp_subtransport *t, winhttp_stream *s) { + GIT_UNUSED(t); + s->service = receive_pack_service; s->service_url = receive_pack_ls_service_url; s->verb = get_verb; @@ -1228,6 +1230,8 @@ winhttp_subtransport *t, winhttp_stream *s) { + GIT_UNUSED(t); + /* WinHTTP only supports Transfer-Encoding: chunked * on Windows Vista (NT 6.0) and higher. */ s->chunked = git_has_win32_version(6, 0, 0); @@ -1256,7 +1260,7 @@ if (!t->connection) if ((ret = gitno_connection_data_from_url(&t->connection_data, url, NULL)) < 0 || - (ret = winhttp_connect(t, url)) < 0) + (ret = winhttp_connect(t)) < 0) return ret; if (winhttp_stream_alloc(t, &s) < 0) @@ -1322,14 +1326,16 @@ git__free(t); } -int git_smart_subtransport_http(git_smart_subtransport **out, git_transport *owner) +int git_smart_subtransport_http(git_smart_subtransport **out, git_transport *owner, void *param) { winhttp_subtransport *t; + GIT_UNUSED(param); + if (!out) return -1; - t = git__calloc(sizeof(winhttp_subtransport), 1); + t = git__calloc(1, sizeof(winhttp_subtransport)); GITERR_CHECK_ALLOC(t); t->owner = (transport_smart *)owner; diff -Nru libgit2-0.22.2/src/tree.c libgit2-0.23.1/src/tree.c --- libgit2-0.22.2/src/tree.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/tree.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,7 +17,7 @@ #define DEFAULT_TREE_SIZE 16 #define MAX_FILEMODE_BYTES 6 -GIT__USE_STRMAP; +GIT__USE_STRMAP static bool valid_filemode(const int filemode) { @@ -84,10 +84,11 @@ static git_tree_entry *alloc_entry(const char *filename) { git_tree_entry *entry = NULL; - size_t filename_len = strlen(filename); + size_t filename_len = strlen(filename), tree_len; - entry = git__malloc(sizeof(git_tree_entry) + filename_len + 1); - if (!entry) + if (GIT_ADD_SIZET_OVERFLOW(&tree_len, sizeof(git_tree_entry), filename_len) || + GIT_ADD_SIZET_OVERFLOW(&tree_len, tree_len, 1) || + !(entry = git__malloc(tree_len))) return NULL; memset(entry, 0x0, sizeof(git_tree_entry)); @@ -210,7 +211,8 @@ assert(source); - total_size = sizeof(git_tree_entry) + source->filename_len + 1; + GITERR_CHECK_ALLOC_ADD(&total_size, sizeof(git_tree_entry), source->filename_len); + GITERR_CHECK_ALLOC_ADD(&total_size, total_size, 1); copy = git__malloc(total_size); GITERR_CHECK_ALLOC(copy); @@ -856,7 +858,7 @@ if (entry == NULL) { giterr_set(GITERR_TREE, - "The path '%s' does not exist in the given tree", path); + "the path '%.*s' does not exist in the given tree", filename_len, path); return GIT_ENOTFOUND; } @@ -866,7 +868,7 @@ * then this entry *must* be a tree */ if (!git_tree_entry__is_tree(entry)) { giterr_set(GITERR_TREE, - "The path '%s' does not exist in the given tree", path); + "the path '%.*s' exists but is not a tree", filename_len, path); return GIT_ENOTFOUND; } diff -Nru libgit2-0.22.2/src/tsort.c libgit2-0.23.1/src/tsort.c --- libgit2-0.22.2/src/tsort.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/tsort.c 2015-08-03 18:07:35.000000000 +0000 @@ -184,7 +184,9 @@ static int resize(struct tsort_store *store, size_t new_size) { if (store->alloc < new_size) { - void **tempstore = git__realloc(store->storage, new_size * sizeof(void *)); + void **tempstore; + + tempstore = git__reallocarray(store->storage, new_size, sizeof(void *)); /** * Do not propagate on OOM; this will abort the sort and diff -Nru libgit2-0.22.2/src/unix/posix.h libgit2-0.23.1/src/unix/posix.h --- libgit2-0.22.2/src/unix/posix.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/unix/posix.h 2015-08-03 18:07:35.000000000 +0000 @@ -8,7 +8,10 @@ #define INCLUDE_posix__unix_h__ #include +#include #include +#include +#include typedef int GIT_SOCKET; #define INVALID_SOCKET -1 @@ -18,6 +21,9 @@ #define p_lstat(p,b) lstat(p,b) #define p_stat(p,b) stat(p, b) +#define p_utimes(f, t) utimes(f, t) +#define p_futimes(f, t) futimes(f, t) + #define p_readlink(a, b, c) readlink(a, b, c) #define p_symlink(o,n) symlink(o, n) #define p_link(o,n) link(o, n) diff -Nru libgit2-0.22.2/src/util.c libgit2-0.23.1/src/util.c --- libgit2-0.22.2/src/util.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/util.c 2015-08-03 18:07:35.000000000 +0000 @@ -171,9 +171,9 @@ int git__strcasecmp(const char *a, const char *b) { - while (*a && *b && tolower(*a) == tolower(*b)) + while (*a && *b && git__tolower(*a) == git__tolower(*b)) ++a, ++b; - return (tolower(*a) - tolower(*b)); + return ((unsigned char)git__tolower(*a) - (unsigned char)git__tolower(*b)); } int git__strcasesort_cmp(const char *a, const char *b) @@ -182,7 +182,7 @@ while (*a && *b) { if (*a != *b) { - if (tolower(*a) != tolower(*b)) + if (git__tolower(*a) != git__tolower(*b)) break; /* use case in sort order even if not in equivalence */ if (!cmp) @@ -193,7 +193,7 @@ } if (*a || *b) - return tolower(*a) - tolower(*b); + return (unsigned char)git__tolower(*a) - (unsigned char)git__tolower(*b); return cmp; } @@ -212,8 +212,8 @@ int al, bl; do { - al = (unsigned char)tolower(*a); - bl = (unsigned char)tolower(*b); + al = (unsigned char)git__tolower(*a); + bl = (unsigned char)git__tolower(*b); ++a, ++b; } while (--sz && al && al == bl); @@ -225,7 +225,7 @@ size_t i; for (i = 0; i < len; ++i) { - str[i] = (char) tolower(str[i]); + str[i] = (char)git__tolower(str[i]); } } @@ -255,8 +255,8 @@ int s, p; while(str_n--) { - s = (unsigned char)tolower(*str++); - p = (unsigned char)tolower(*prefix++); + s = (unsigned char)git__tolower(*str++); + p = (unsigned char)git__tolower(*prefix++); if (s != p) return s - p; @@ -665,6 +665,31 @@ git__free(swapel); } +/* + * git__utf8_iterate is taken from the utf8proc project, + * http://www.public-software-group.org/utf8proc + * + * Copyright (c) 2009 Public Software Group e. V., Berlin, Germany + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the ""Software""), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + static const int8_t utf8proc_utf8class[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, diff -Nru libgit2-0.22.2/src/util.h libgit2-0.23.1/src/util.h --- libgit2-0.22.2/src/util.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/util.h 2015-08-03 18:07:35.000000000 +0000 @@ -7,6 +7,36 @@ #ifndef INCLUDE_util_h__ #define INCLUDE_util_h__ +#if defined(GIT_MSVC_CRTDBG) +/* Enable MSVC CRTDBG memory leak reporting. + * + * We DO NOT use the "_CRTDBG_MAP_ALLOC" macro described in the MSVC + * documentation because all allocs/frees in libgit2 already go through + * the "git__" routines defined in this file. Simply using the normal + * reporting mechanism causes all leaks to be attributed to a routine + * here in util.h (ie, the actual call to calloc()) rather than the + * caller of git__calloc(). + * + * Therefore, we declare a set of "git__crtdbg__" routines to replace + * the corresponding "git__" routines and re-define the "git__" symbols + * as macros. This allows us to get and report the file:line info of + * the real caller. + * + * We DO NOT replace the "git__free" routine because it needs to remain + * a function pointer because it is used as a function argument when + * setting up various structure "destructors". + * + * We also DO NOT use the "_CRTDBG_MAP_ALLOC" macro because it causes + * "free" to be remapped to "_free_dbg" and this causes problems for + * structures which define a field named "free". + * + * Finally, CRTDBG must be explicitly enabled and configured at program + * startup. See tests/main.c for an example. + */ +#include +#include +#endif + #include "common.h" #include "strnlen.h" @@ -31,6 +61,91 @@ */ #define CONST_STRLEN(x) ((sizeof(x)/sizeof(x[0])) - 1) +#if defined(GIT_MSVC_CRTDBG) +GIT_INLINE(void *) git__crtdbg__malloc(size_t len, const char *file, int line) +{ + void *ptr = _malloc_dbg(len, _NORMAL_BLOCK, file, line); + if (!ptr) giterr_set_oom(); + return ptr; +} + +GIT_INLINE(void *) git__crtdbg__calloc(size_t nelem, size_t elsize, const char *file, int line) +{ + void *ptr = _calloc_dbg(nelem, elsize, _NORMAL_BLOCK, file, line); + if (!ptr) giterr_set_oom(); + return ptr; +} + +GIT_INLINE(char *) git__crtdbg__strdup(const char *str, const char *file, int line) +{ + char *ptr = _strdup_dbg(str, _NORMAL_BLOCK, file, line); + if (!ptr) giterr_set_oom(); + return ptr; +} + +GIT_INLINE(char *) git__crtdbg__strndup(const char *str, size_t n, const char *file, int line) +{ + size_t length = 0, alloclength; + char *ptr; + + length = p_strnlen(str, n); + + if (GIT_ADD_SIZET_OVERFLOW(&alloclength, length, 1) || + !(ptr = git__crtdbg__malloc(alloclength, file, line))) + return NULL; + + if (length) + memcpy(ptr, str, length); + + ptr[length] = '\0'; + + return ptr; +} + +GIT_INLINE(char *) git__crtdbg__substrdup(const char *start, size_t n, const char *file, int line) +{ + char *ptr; + size_t alloclen; + + if (GIT_ADD_SIZET_OVERFLOW(&alloclen, n, 1) || + !(ptr = git__crtdbg__malloc(alloclen, file, line))) + return NULL; + + memcpy(ptr, start, n); + ptr[n] = '\0'; + return ptr; +} + +GIT_INLINE(void *) git__crtdbg__realloc(void *ptr, size_t size, const char *file, int line) +{ + void *new_ptr = _realloc_dbg(ptr, size, _NORMAL_BLOCK, file, line); + if (!new_ptr) giterr_set_oom(); + return new_ptr; +} + +GIT_INLINE(void *) git__crtdbg__reallocarray(void *ptr, size_t nelem, size_t elsize, const char *file, int line) +{ + size_t newsize; + return GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize) ? + NULL : _realloc_dbg(ptr, newsize, _NORMAL_BLOCK, file, line); +} + +GIT_INLINE(void *) git__crtdbg__mallocarray(size_t nelem, size_t elsize, const char *file, int line) +{ + return git__crtdbg__reallocarray(NULL, nelem, elsize, file, line); +} + +#define git__malloc(len) git__crtdbg__malloc(len, __FILE__, __LINE__) +#define git__calloc(nelem, elsize) git__crtdbg__calloc(nelem, elsize, __FILE__, __LINE__) +#define git__strdup(str) git__crtdbg__strdup(str, __FILE__, __LINE__) +#define git__strndup(str, n) git__crtdbg__strndup(str, n, __FILE__, __LINE__) +#define git__substrdup(str, n) git__crtdbg__substrdup(str, n, __FILE__, __LINE__) +#define git__realloc(ptr, size) git__crtdbg__realloc(ptr, size, __FILE__, __LINE__) +#define git__reallocarray(ptr, nelem, elsize) git__crtdbg__reallocarray(ptr, nelem, elsize, __FILE__, __LINE__) +#define git__mallocarray(nelem, elsize) git__crtdbg__mallocarray(nelem, elsize, __FILE__, __LINE__) + +#else + /* * Custom memory allocation wrappers * that set error code and error message @@ -59,14 +174,13 @@ GIT_INLINE(char *) git__strndup(const char *str, size_t n) { - size_t length = 0; + size_t length = 0, alloclength; char *ptr; length = p_strnlen(str, n); - ptr = (char*)git__malloc(length + 1); - - if (!ptr) + if (GIT_ADD_SIZET_OVERFLOW(&alloclength, length, 1) || + !(ptr = git__malloc(alloclength))) return NULL; if (length) @@ -80,7 +194,13 @@ /* NOTE: This doesn't do null or '\0' checking. Watch those boundaries! */ GIT_INLINE(char *) git__substrdup(const char *start, size_t n) { - char *ptr = (char*)git__malloc(n+1); + char *ptr; + size_t alloclen; + + if (GIT_ADD_SIZET_OVERFLOW(&alloclen, n, 1) || + !(ptr = git__malloc(alloclen))) + return NULL; + memcpy(ptr, start, n); ptr[n] = '\0'; return ptr; @@ -93,6 +213,28 @@ return new_ptr; } +/** + * Similar to `git__realloc`, except that it is suitable for reallocing an + * array to a new number of elements of `nelem`, each of size `elsize`. + * The total size calculation is checked for overflow. + */ +GIT_INLINE(void *) git__reallocarray(void *ptr, size_t nelem, size_t elsize) +{ + size_t newsize; + return GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize) ? + NULL : realloc(ptr, newsize); +} + +/** + * Similar to `git__calloc`, except that it does not zero memory. + */ +GIT_INLINE(void *) git__mallocarray(size_t nelem, size_t elsize) +{ + return git__reallocarray(NULL, nelem, elsize); +} + +#endif /* !MSVC_CTRDBG */ + GIT_INLINE(void) git__free(void *ptr) { free(ptr); @@ -120,27 +262,6 @@ extern void git__hexdump(const char *buffer, size_t n); extern uint32_t git__hash(const void *key, int len, uint32_t seed); -/** @return true if p fits into the range of a size_t */ -GIT_INLINE(int) git__is_sizet(git_off_t p) -{ - size_t r = (size_t)p; - return p == (git_off_t)r; -} - -/** @return true if p fits into the range of a uint32_t */ -GIT_INLINE(int) git__is_uint32(size_t p) -{ - uint32_t r = (uint32_t)p; - return p == (size_t)r; -} - -/** @return true if p fits into the range of an unsigned long */ -GIT_INLINE(int) git__is_ulong(git_off_t p) -{ - unsigned long r = (unsigned long)p; - return p == (git_off_t)r; -} - /* 32-bit cross-platform rotl */ #ifdef _MSC_VER /* use built-in method in MSVC */ # define git__rotl(v, s) (uint32_t)_rotl(v, s) @@ -154,6 +275,15 @@ extern void git__strntolower(char *str, size_t len); extern void git__strtolower(char *str); +#ifdef GIT_WIN32 +GIT_INLINE(int) git__tolower(int c) +{ + return (c >= 'A' && c <= 'Z') ? (c + 32) : c; +} +#else +# define git__tolower(a) tolower(a) +#endif + GIT_INLINE(const char *) git__next_line(const char *s) { while (*s && *s != '\n') s++; @@ -277,7 +407,7 @@ GIT_INLINE(int) git__ishex(const char *str) { unsigned i; - for (i=0; icontents, new_bytes); + new_contents = git__reallocarray(v->contents, new_size, sizeof(void *)); GITERR_CHECK_ALLOC(new_contents); v->_alloc_size = new_size; @@ -51,7 +46,7 @@ assert(v && src); - bytes = src->length * sizeof(void *); + GITERR_CHECK_ALLOC_MULTIPLY(&bytes, src->length, sizeof(void *)); v->_alloc_size = src->length; v->_cmp = cmp ? cmp : src->_cmp; diff -Nru libgit2-0.22.2/src/win32/buffer.c libgit2-0.23.1/src/win32/buffer.c --- libgit2-0.22.2/src/win32/buffer.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/win32/buffer.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,55 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ + +#include "common.h" +#include "buffer.h" +#include "../buffer.h" +#include "utf-conv.h" + +GIT_INLINE(int) handle_wc_error(void) +{ + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + errno = ENAMETOOLONG; + else + errno = EINVAL; + + return -1; +} + +int git_buf_put_w(git_buf *buf, const wchar_t *string_w, size_t len_w) +{ + int utf8_len, utf8_write_len; + size_t new_size; + + if (!len_w) + return 0; + + assert(string_w); + + /* Measure the string necessary for conversion */ + if ((utf8_len = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, string_w, len_w, NULL, 0, NULL, NULL)) == 0) + return 0; + + assert(utf8_len > 0); + + GITERR_CHECK_ALLOC_ADD(&new_size, buf->size, (size_t)utf8_len); + GITERR_CHECK_ALLOC_ADD(&new_size, new_size, 1); + + if (git_buf_grow(buf, new_size) < 0) + return -1; + + if ((utf8_write_len = WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, string_w, len_w, &buf->ptr[buf->size], utf8_len, NULL, NULL)) == 0) + return handle_wc_error(); + + assert(utf8_write_len == utf8_len); + + buf->size += utf8_write_len; + buf->ptr[buf->size] = '\0'; + return 0; +} + diff -Nru libgit2-0.22.2/src/win32/buffer.h libgit2-0.23.1/src/win32/buffer.h --- libgit2-0.22.2/src/win32/buffer.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/src/win32/buffer.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,18 @@ +/* + * Copyright (C) the libgit2 contributors. All rights reserved. + * + * This file is part of libgit2, distributed under the GNU GPL v2 with + * a Linking Exception. For full terms see the included COPYING file. + */ +#ifndef INCLUDE_git_win32_buffer_h__ +#define INCLUDE_git_win32_buffer_h__ + +#include "../buffer.h" + +/** + * Convert a wide character string to UTF-8 and append the results to the + * buffer. + */ +int git_buf_put_w(git_buf *buf, const wchar_t *string_w, size_t len_w); + +#endif diff -Nru libgit2-0.22.2/src/win32/dir.c libgit2-0.23.1/src/win32/dir.c --- libgit2-0.22.2/src/win32/dir.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/dir.c 2015-08-03 18:07:35.000000000 +0000 @@ -11,16 +11,18 @@ { git_win32_path filter_w; git__DIR *new = NULL; - size_t dirlen; + size_t dirlen, alloclen; if (!dir || !git_win32__findfirstfile_filter(filter_w, dir)) return NULL; dirlen = strlen(dir); - new = git__calloc(sizeof(*new) + dirlen + 1, 1); - if (!new) + if (GIT_ADD_SIZET_OVERFLOW(&alloclen, sizeof(*new), dirlen) || + GIT_ADD_SIZET_OVERFLOW(&alloclen, alloclen, 1) || + !(new = git__calloc(1, alloclen))) return NULL; + memcpy(new->dir, dir, dirlen); new->h = FindFirstFileW(filter_w, &new->f); diff -Nru libgit2-0.22.2/src/win32/git2.rc libgit2-0.23.1/src/win32/git2.rc --- libgit2-0.22.2/src/win32/git2.rc 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/git2.rc 2015-08-03 18:07:35.000000000 +0000 @@ -2,12 +2,16 @@ #include "../../include/git2/version.h" #ifndef LIBGIT2_FILENAME -# define LIBGIT2_FILENAME "git2" +# define LIBGIT2_FILENAME "git2" +#endif + +#ifndef LIBGIT2_COMMENTS +# define LIBGIT2_COMMENTS "For more information visit http://libgit2.github.com/" #endif VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE - FILEVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,0 - PRODUCTVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,0 + FILEVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,LIBGIT2_VER_PATCH + PRODUCTVERSION LIBGIT2_VER_MAJOR,LIBGIT2_VER_MINOR,LIBGIT2_VER_REVISION,LIBGIT2_VER_PATCH FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG @@ -30,7 +34,7 @@ VALUE "OriginalFilename", LIBGIT2_FILENAME ".dll\0" VALUE "ProductName", "libgit2\0" VALUE "ProductVersion", LIBGIT2_VERSION "\0" - VALUE "Comments", "For more information visit http://libgit2.github.com/\0" + VALUE "Comments", LIBGIT2_COMMENTS "\0" END END BLOCK "VarFileInfo" diff -Nru libgit2-0.22.2/src/win32/mingw-compat.h libgit2-0.23.1/src/win32/mingw-compat.h --- libgit2-0.22.2/src/win32/mingw-compat.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/mingw-compat.h 2015-08-03 18:07:35.000000000 +0000 @@ -17,6 +17,13 @@ #define stat _stati64 #endif +#if _WIN32_WINNT < 0x0600 && !defined(__MINGW64_VERSION_MAJOR) +#undef MemoryBarrier +void __mingworg_MemoryBarrier(void); +#define MemoryBarrier __mingworg_MemoryBarrier +#define VOLUME_NAME_DOS 0x0 +#endif + #endif #endif /* INCLUDE_mingw_compat__ */ diff -Nru libgit2-0.22.2/src/win32/msvc-compat.h libgit2-0.23.1/src/win32/msvc-compat.h --- libgit2-0.22.2/src/win32/msvc-compat.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/msvc-compat.h 2015-08-03 18:07:35.000000000 +0000 @@ -15,6 +15,9 @@ typedef unsigned short mode_t; typedef SSIZE_T ssize_t; +#define strcasecmp(s1, s2) _stricmp(s1, s2) +#define strncasecmp(s1, s2, c) _strnicmp(s1, s2, c) + #endif #define GIT_STDLIB_CALL __cdecl diff -Nru libgit2-0.22.2/src/win32/path_w32.c libgit2-0.23.1/src/win32/path_w32.c --- libgit2-0.22.2/src/win32/path_w32.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/path_w32.c 2015-08-03 18:07:35.000000000 +0000 @@ -9,6 +9,9 @@ #include "path.h" #include "path_w32.h" #include "utf-conv.h" +#include "posix.h" +#include "reparse.h" +#include "dir.h" #define PATH__NT_NAMESPACE L"\\\\?\\" #define PATH__NT_NAMESPACE_LEN 4 @@ -303,3 +306,75 @@ return shortname; } + +static bool path_is_volume(wchar_t *target, size_t target_len) +{ + return (target_len && wcsncmp(target, L"\\??\\Volume{", 11) == 0); +} + +/* On success, returns the length, in characters, of the path stored in dest. +* On failure, returns a negative value. */ +int git_win32_path_readlink_w(git_win32_path dest, const git_win32_path path) +{ + BYTE buf[MAXIMUM_REPARSE_DATA_BUFFER_SIZE]; + GIT_REPARSE_DATA_BUFFER *reparse_buf = (GIT_REPARSE_DATA_BUFFER *)buf; + HANDLE handle = NULL; + DWORD ioctl_ret; + wchar_t *target; + size_t target_len; + + int error = -1; + + handle = CreateFileW(path, GENERIC_READ, + FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, + FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); + + if (handle == INVALID_HANDLE_VALUE) { + errno = ENOENT; + return -1; + } + + if (!DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, NULL, 0, + reparse_buf, sizeof(buf), &ioctl_ret, NULL)) { + errno = EINVAL; + goto on_error; + } + + switch (reparse_buf->ReparseTag) { + case IO_REPARSE_TAG_SYMLINK: + target = reparse_buf->SymbolicLinkReparseBuffer.PathBuffer + + (reparse_buf->SymbolicLinkReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)); + target_len = reparse_buf->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(WCHAR); + break; + case IO_REPARSE_TAG_MOUNT_POINT: + target = reparse_buf->MountPointReparseBuffer.PathBuffer + + (reparse_buf->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)); + target_len = reparse_buf->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); + break; + default: + errno = EINVAL; + goto on_error; + } + + if (path_is_volume(target, target_len)) { + /* This path is a reparse point that represents another volume mounted + * at this location, it is not a symbolic link our input was canonical. + */ + errno = EINVAL; + error = -1; + } else if (target_len) { + /* The path may need to have a prefix removed. */ + target_len = git_win32__canonicalize_path(target, target_len); + + /* Need one additional character in the target buffer + * for the terminating NULL. */ + if (GIT_WIN_PATH_UTF16 > target_len) { + wcscpy(dest, target); + error = (int)target_len; + } + } + +on_error: + CloseHandle(handle); + return error; +} diff -Nru libgit2-0.22.2/src/win32/path_w32.h libgit2-0.23.1/src/win32/path_w32.h --- libgit2-0.22.2/src/win32/path_w32.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/path_w32.h 2015-08-03 18:07:35.000000000 +0000 @@ -8,6 +8,7 @@ #define INCLUDE_git_path_w32_h__ #include "common.h" +#include "vector.h" /* * Provides a large enough buffer to support Windows paths: MAX_PATH is @@ -79,4 +80,6 @@ */ extern char *git_win32_path_8dot3_name(const char *path); +extern int git_win32_path_readlink_w(git_win32_path dest, const git_win32_path path); + #endif diff -Nru libgit2-0.22.2/src/win32/posix.h libgit2-0.23.1/src/win32/posix.h --- libgit2-0.22.2/src/win32/posix.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/posix.h 2015-08-03 18:07:35.000000000 +0000 @@ -20,6 +20,9 @@ extern int p_lstat(const char *file_name, struct stat *buf); extern int p_stat(const char* path, struct stat* buf); +extern int p_utimes(const char *filename, const struct timeval times[2]); +extern int p_futimes(int fd, const struct timeval times[2]); + extern int p_readlink(const char *path, char *buf, size_t bufsiz); extern int p_symlink(const char *old, const char *new); extern int p_link(const char *old, const char *new); @@ -32,8 +35,6 @@ extern int p_send(GIT_SOCKET socket, const void *buffer, size_t length, int flags); extern int p_inet_pton(int af, const char* src, void* dst); -#define strcasecmp(s1, s2) _stricmp(s1, s2) -#define strncasecmp(s1, s2, c) _strnicmp(s1, s2, c) extern int p_vsnprintf(char *buffer, size_t count, const char *format, va_list argptr); extern int p_snprintf(char *buffer, size_t count, const char *format, ...) GIT_FORMAT_PRINTF(3, 4); extern int p_mkstemp(char *tmp_path); @@ -41,7 +42,7 @@ extern int p_chmod(const char* path, mode_t mode); extern int p_rmdir(const char* path); extern int p_access(const char* path, mode_t mode); -extern int p_ftruncate(int fd, long size); +extern int p_ftruncate(int fd, git_off_t size); /* p_lstat is almost but not quite POSIX correct. Specifically, the use of * ENOTDIR is wrong, in that it does not mean precisely that a non-directory @@ -51,7 +52,7 @@ */ extern int p_lstat_posixly(const char *filename, struct stat *buf); -extern struct tm * p_localtime_r (const time_t *timer, struct tm *result); -extern struct tm * p_gmtime_r (const time_t *timer, struct tm *result); +extern struct tm * p_localtime_r(const time_t *timer, struct tm *result); +extern struct tm * p_gmtime_r(const time_t *timer, struct tm *result); #endif diff -Nru libgit2-0.22.2/src/win32/posix_w32.c libgit2-0.23.1/src/win32/posix_w32.c --- libgit2-0.22.2/src/win32/posix_w32.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/posix_w32.c 2015-08-03 18:07:35.000000000 +0000 @@ -33,15 +33,37 @@ * inheritable on Windows, so specify the flag to get default behavior back. */ #define STANDARD_OPEN_FLAGS (_O_BINARY | _O_NOINHERIT) +/* Allowable mode bits on Win32. Using mode bits that are not supported on + * Win32 (eg S_IRWXU) is generally ignored, but Wine warns loudly about it + * so we simply remove them. + */ +#define WIN32_MODE_MASK (_S_IREAD | _S_IWRITE) + /* GetFinalPathNameByHandleW signature */ typedef DWORD(WINAPI *PFGetFinalPathNameByHandleW)(HANDLE, LPWSTR, DWORD, DWORD); -int p_ftruncate(int fd, long size) +/** + * Truncate or extend file. + * + * We now take a "git_off_t" rather than "long" because + * files may be longer than 2Gb. + */ +int p_ftruncate(int fd, git_off_t size) { -#if defined(_MSC_VER) && _MSC_VER >= 1500 - return _chsize_s(fd, size); + if (size < 0) { + errno = EINVAL; + return -1; + } + +#if !defined(__MINGW32__) || defined(MINGW_HAS_SECURE_API) + return ((_chsize_s(fd, size) == 0) ? 0 : -1); #else - return _chsize(fd, size); + /* TODO MINGW32 Find a replacement for _chsize() that handles big files. */ + if (size > INT32_MAX) { + errno = EFBIG; + return -1; + } + return _chsize(fd, (long)size); #endif } @@ -108,88 +130,6 @@ return 0; } -GIT_INLINE(time_t) filetime_to_time_t(const FILETIME *ft) -{ - long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime; - winTime -= 116444736000000000LL; /* Windows to Unix Epoch conversion */ - winTime /= 10000000; /* Nano to seconds resolution */ - return (time_t)winTime; -} - -static bool path_is_volume(wchar_t *target, size_t target_len) -{ - return (target_len && wcsncmp(target, L"\\??\\Volume{", 11) == 0); -} - -/* On success, returns the length, in characters, of the path stored in dest. - * On failure, returns a negative value. */ -static int readlink_w( - git_win32_path dest, - const git_win32_path path) -{ - BYTE buf[MAXIMUM_REPARSE_DATA_BUFFER_SIZE]; - GIT_REPARSE_DATA_BUFFER *reparse_buf = (GIT_REPARSE_DATA_BUFFER *)buf; - HANDLE handle = NULL; - DWORD ioctl_ret; - wchar_t *target; - size_t target_len; - - int error = -1; - - handle = CreateFileW(path, GENERIC_READ, - FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, - FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL); - - if (handle == INVALID_HANDLE_VALUE) { - errno = ENOENT; - return -1; - } - - if (!DeviceIoControl(handle, FSCTL_GET_REPARSE_POINT, NULL, 0, - reparse_buf, sizeof(buf), &ioctl_ret, NULL)) { - errno = EINVAL; - goto on_error; - } - - switch (reparse_buf->ReparseTag) { - case IO_REPARSE_TAG_SYMLINK: - target = reparse_buf->SymbolicLinkReparseBuffer.PathBuffer + - (reparse_buf->SymbolicLinkReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)); - target_len = reparse_buf->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(WCHAR); - break; - case IO_REPARSE_TAG_MOUNT_POINT: - target = reparse_buf->MountPointReparseBuffer.PathBuffer + - (reparse_buf->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)); - target_len = reparse_buf->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR); - break; - default: - errno = EINVAL; - goto on_error; - } - - if (path_is_volume(target, target_len)) { - /* This path is a reparse point that represents another volume mounted - * at this location, it is not a symbolic link our input was canonical. - */ - errno = EINVAL; - error = -1; - } else if (target_len) { - /* The path may need to have a prefix removed. */ - target_len = git_win32__canonicalize_path(target, target_len); - - /* Need one additional character in the target buffer - * for the terminating NULL. */ - if (GIT_WIN_PATH_UTF16 > target_len) { - wcscpy(dest, target); - error = (int)target_len; - } - } - -on_error: - CloseHandle(handle); - return error; -} - #define WIN32_IS_WSEP(CH) ((CH) == L'/' || (CH) == L'\\') static int lstat_w( @@ -200,44 +140,10 @@ WIN32_FILE_ATTRIBUTE_DATA fdata; if (GetFileAttributesExW(path, GetFileExInfoStandard, &fdata)) { - int fMode = S_IREAD; - if (!buf) return 0; - if (fdata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - fMode |= S_IFDIR; - else - fMode |= S_IFREG; - - if (!(fdata.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) - fMode |= S_IWRITE; - - buf->st_ino = 0; - buf->st_gid = 0; - buf->st_uid = 0; - buf->st_nlink = 1; - buf->st_mode = (mode_t)fMode; - buf->st_size = ((git_off_t)fdata.nFileSizeHigh << 32) + fdata.nFileSizeLow; - buf->st_dev = buf->st_rdev = (_getdrive() - 1); - buf->st_atime = filetime_to_time_t(&(fdata.ftLastAccessTime)); - buf->st_mtime = filetime_to_time_t(&(fdata.ftLastWriteTime)); - buf->st_ctime = filetime_to_time_t(&(fdata.ftCreationTime)); - - if (fdata.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) { - git_win32_path target; - - if (readlink_w(target, path) >= 0) { - buf->st_mode = (buf->st_mode & ~S_IFMT) | S_IFLNK; - - /* st_size gets the UTF-8 length of the target name, in bytes, - * not counting the NULL terminator */ - if ((buf->st_size = git__utf16_to_8(NULL, 0, target)) < 0) - return -1; - } - } - - return 0; + return git_win32__file_attribute_to_stat(buf, &fdata, path); } errno = ENOENT; @@ -295,6 +201,44 @@ return do_lstat(filename, buf, true); } +int p_utimes(const char *filename, const struct timeval times[2]) +{ + int fd, error; + + if ((fd = p_open(filename, O_RDWR)) < 0) + return fd; + + error = p_futimes(fd, times); + + close(fd); + return error; +} + +int p_futimes(int fd, const struct timeval times[2]) +{ + HANDLE handle; + FILETIME atime = {0}, mtime = {0}; + + if (times == NULL) { + SYSTEMTIME st; + + GetSystemTime(&st); + SystemTimeToFileTime(&st, &atime); + SystemTimeToFileTime(&st, &mtime); + } else { + git_win32__timeval_to_filetime(&atime, times[0]); + git_win32__timeval_to_filetime(&mtime, times[1]); + } + + if ((handle = (HANDLE)_get_osfhandle(fd)) == INVALID_HANDLE_VALUE) + return -1; + + if (SetFileTime(handle, NULL, &atime, &mtime) == 0) + return -1; + + return 0; +} + int p_readlink(const char *path, char *buf, size_t bufsiz) { git_win32_path path_w, target_w; @@ -309,7 +253,7 @@ * we need to buffer the result on the stack. */ if (git_win32_path_from_utf8(path_w, path) < 0 || - readlink_w(target_w, path_w) < 0 || + git_win32_path_readlink_w(target_w, path_w) < 0 || (len = git_win32_path_to_utf8(target, target_w)) < 0) return -1; @@ -343,7 +287,7 @@ va_end(arg_list); } - return _wopen(buf, flags | STANDARD_OPEN_FLAGS, mode); + return _wopen(buf, flags | STANDARD_OPEN_FLAGS, mode & WIN32_MODE_MASK); } int p_creat(const char *path, mode_t mode) @@ -353,7 +297,9 @@ if (git_win32_path_from_utf8(buf, path) < 0) return -1; - return _wopen(buf, _O_WRONLY | _O_CREAT | _O_TRUNC | STANDARD_OPEN_FLAGS, mode); + return _wopen(buf, + _O_WRONLY | _O_CREAT | _O_TRUNC | STANDARD_OPEN_FLAGS, + mode & WIN32_MODE_MASK); } int p_getcwd(char *buffer_out, size_t size) @@ -607,7 +553,7 @@ if (git_win32_path_from_utf8(buf, path) < 0) return -1; - return _waccess(buf, mode); + return _waccess(buf, mode & WIN32_MODE_MASK); } static int ensure_writable(wchar_t *fpath) diff -Nru libgit2-0.22.2/src/win32/pthread.c libgit2-0.23.1/src/win32/pthread.c --- libgit2-0.22.2/src/win32/pthread.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/pthread.c 2015-08-03 18:07:35.000000000 +0000 @@ -20,6 +20,8 @@ thread->result = thread->proc(thread->param); + git__free_tls_data(); + return CLEAN_THREAD_EXIT; } diff -Nru libgit2-0.22.2/src/win32/utf-conv.c libgit2-0.23.1/src/win32/utf-conv.c --- libgit2-0.22.2/src/win32/utf-conv.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/utf-conv.c 2015-08-03 18:07:35.000000000 +0000 @@ -8,10 +8,6 @@ #include "common.h" #include "utf-conv.h" -#ifndef WC_ERR_INVALID_CHARS -# define WC_ERR_INVALID_CHARS 0x80 -#endif - GIT_INLINE(DWORD) get_wc_flags(void) { static char inited = 0; @@ -99,9 +95,7 @@ return -1; } - *dest = git__malloc(utf16_size * sizeof(wchar_t)); - - if (!*dest) { + if (!(*dest = git__mallocarray(utf16_size, sizeof(wchar_t)))) { errno = ENOMEM; return -1; } diff -Nru libgit2-0.22.2/src/win32/utf-conv.h libgit2-0.23.1/src/win32/utf-conv.h --- libgit2-0.22.2/src/win32/utf-conv.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/utf-conv.h 2015-08-03 18:07:35.000000000 +0000 @@ -10,6 +10,10 @@ #include #include "common.h" +#ifndef WC_ERR_INVALID_CHARS +# define WC_ERR_INVALID_CHARS 0x80 +#endif + /** * Converts a UTF-8 string to wide characters. * diff -Nru libgit2-0.22.2/src/win32/w32_util.h libgit2-0.23.1/src/win32/w32_util.h --- libgit2-0.22.2/src/win32/w32_util.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/win32/w32_util.h 2015-08-03 18:07:35.000000000 +0000 @@ -9,8 +9,21 @@ #define INCLUDE_w32_util_h__ #include "utf-conv.h" +#include "posix.h" #include "path_w32.h" +/* + +#include "common.h" +#include "path.h" +#include "path_w32.h" +#include "utf-conv.h" +#include "posix.h" +#include "reparse.h" +#include "dir.h" +*/ + + GIT_INLINE(bool) git_win32__isalpha(wchar_t c) { return ((c >= L'A' && c <= L'Z') || (c >= L'a' && c <= L'z')); @@ -52,4 +65,73 @@ */ size_t git_win32__canonicalize_path(wchar_t *str, size_t len); +/** + * Converts a FILETIME structure to a time_t. + * + * @param FILETIME A pointer to a FILETIME + * @return A time_t containing the same time + */ +GIT_INLINE(time_t) git_win32__filetime_to_time_t(const FILETIME *ft) +{ + long long winTime = ((long long)ft->dwHighDateTime << 32) + ft->dwLowDateTime; + winTime -= 116444736000000000LL; /* Windows to Unix Epoch conversion */ + winTime /= 10000000; /* Nano to seconds resolution */ + return (time_t)winTime; +} + +GIT_INLINE(void) git_win32__timeval_to_filetime( + FILETIME *ft, const struct timeval tv) +{ + long long ticks = (tv.tv_sec * 10000000LL) + + (tv.tv_usec * 10LL) + 116444736000000000LL; + + ft->dwHighDateTime = ((ticks >> 32) & 0xffffffffLL); + ft->dwLowDateTime = (ticks & 0xffffffffLL); +} + +GIT_INLINE(int) git_win32__file_attribute_to_stat( + struct stat *st, + const WIN32_FILE_ATTRIBUTE_DATA *attrdata, + const wchar_t *path) +{ + mode_t mode = S_IREAD; + + if (attrdata->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + mode |= S_IFDIR; + else + mode |= S_IFREG; + + if ((attrdata->dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0) + mode |= S_IWRITE; + + st->st_ino = 0; + st->st_gid = 0; + st->st_uid = 0; + st->st_nlink = 1; + st->st_mode = mode; + st->st_size = ((git_off_t)attrdata->nFileSizeHigh << 32) + attrdata->nFileSizeLow; + st->st_dev = _getdrive() - 1; + st->st_rdev = st->st_dev; + st->st_atime = git_win32__filetime_to_time_t(&(attrdata->ftLastAccessTime)); + st->st_mtime = git_win32__filetime_to_time_t(&(attrdata->ftLastWriteTime)); + st->st_ctime = git_win32__filetime_to_time_t(&(attrdata->ftCreationTime)); + + if (attrdata->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT && path) { + git_win32_path target; + + if (git_win32_path_readlink_w(target, path) >= 0) { + st->st_mode = (st->st_mode & ~S_IFMT) | S_IFLNK; + + /* st_size gets the UTF-8 length of the target name, in bytes, + * not counting the NULL terminator */ + if ((st->st_size = git__utf16_to_8(NULL, 0, target)) < 0) { + giterr_set(GITERR_OS, "Could not convert reparse point name for '%s'", path); + return -1; + } + } + } + + return 0; +} + #endif diff -Nru libgit2-0.22.2/src/xdiff/xdiff.h libgit2-0.23.1/src/xdiff/xdiff.h --- libgit2-0.22.2/src/xdiff/xdiff.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xdiff.h 2015-08-03 18:07:35.000000000 +0000 @@ -32,14 +32,14 @@ #define XDF_IGNORE_WHITESPACE (1 << 2) #define XDF_IGNORE_WHITESPACE_CHANGE (1 << 3) #define XDF_IGNORE_WHITESPACE_AT_EOL (1 << 4) +#define XDF_WHITESPACE_FLAGS (XDF_IGNORE_WHITESPACE | XDF_IGNORE_WHITESPACE_CHANGE | XDF_IGNORE_WHITESPACE_AT_EOL) + #define XDF_PATIENCE_DIFF (1 << 5) #define XDF_HISTOGRAM_DIFF (1 << 6) -#define XDF_WHITESPACE_FLAGS (XDF_IGNORE_WHITESPACE | XDF_IGNORE_WHITESPACE_CHANGE | XDF_IGNORE_WHITESPACE_AT_EOL) +#define XDF_DIFF_ALGORITHM_MASK (XDF_PATIENCE_DIFF | XDF_HISTOGRAM_DIFF) +#define XDF_DIFF_ALG(x) ((x) & XDF_DIFF_ALGORITHM_MASK) -#define XDL_PATCH_NORMAL '-' -#define XDL_PATCH_REVERSE '+' -#define XDL_PATCH_MODEMASK ((1 << 8) - 1) -#define XDL_PATCH_IGNOREBSPACE (1 << 8) +#define XDF_IGNORE_BLANK_LINES (1 << 7) #define XDL_EMIT_FUNCNAMES (1 << 0) #define XDL_EMIT_COMMON (1 << 1) @@ -88,13 +88,17 @@ typedef long (*find_func_t)(const char *line, long line_len, char *buffer, long buffer_size, void *priv); +typedef int (*xdl_emit_hunk_consume_func_t)(long start_a, long count_a, + long start_b, long count_b, + void *cb_data); + typedef struct s_xdemitconf { long ctxlen; long interhunkctxlen; unsigned long flags; find_func_t find_func; void *find_func_priv; - void (*emit_func)(void); + xdl_emit_hunk_consume_func_t hunk_func; } xdemitconf_t; typedef struct s_bdiffparam { diff -Nru libgit2-0.22.2/src/xdiff/xdiffi.c libgit2-0.23.1/src/xdiff/xdiffi.c --- libgit2-0.22.2/src/xdiff/xdiffi.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xdiffi.c 2015-08-03 18:07:35.000000000 +0000 @@ -328,10 +328,10 @@ xdalgoenv_t xenv; diffdata_t dd1, dd2; - if (xpp->flags & XDF_PATIENCE_DIFF) + if (XDF_DIFF_ALG(xpp->flags) == XDF_PATIENCE_DIFF) return xdl_do_patience_diff(mf1, mf2, xpp, xe); - if (xpp->flags & XDF_HISTOGRAM_DIFF) + if (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF) return xdl_do_histogram_diff(mf1, mf2, xpp, xe); if (xdl_prepare_env(mf1, mf2, xpp, xe) < 0) { @@ -394,6 +394,7 @@ xch->i2 = i2; xch->chg1 = chg1; xch->chg2 = chg2; + xch->ignore = 0; return xch; } @@ -538,13 +539,51 @@ } } +static int xdl_call_hunk_func(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, + xdemitconf_t const *xecfg) +{ + xdchange_t *xch, *xche; + + (void)xe; + + for (xch = xscr; xch; xch = xche->next) { + xche = xdl_get_hunk(&xch, xecfg); + if (!xch) + break; + if (xecfg->hunk_func(xch->i1, xche->i1 + xche->chg1 - xch->i1, + xch->i2, xche->i2 + xche->chg2 - xch->i2, + ecb->priv) < 0) + return -1; + } + return 0; +} + +static void xdl_mark_ignorable(xdchange_t *xscr, xdfenv_t *xe, long flags) +{ + xdchange_t *xch; + + for (xch = xscr; xch; xch = xch->next) { + int ignore = 1; + xrecord_t **rec; + long i; + + rec = &xe->xdf1.recs[xch->i1]; + for (i = 0; i < xch->chg1 && ignore; i++) + ignore = xdl_blankline(rec[i]->ptr, rec[i]->size, flags); + + rec = &xe->xdf2.recs[xch->i2]; + for (i = 0; i < xch->chg2 && ignore; i++) + ignore = xdl_blankline(rec[i]->ptr, rec[i]->size, flags); + + xch->ignore = ignore; + } +} int xdl_diff(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp, xdemitconf_t const *xecfg, xdemitcb_t *ecb) { xdchange_t *xscr; xdfenv_t xe; - emit_func_t ef = xecfg->emit_func ? - (emit_func_t)xecfg->emit_func : xdl_emit_diff; + emit_func_t ef = xecfg->hunk_func ? xdl_call_hunk_func : xdl_emit_diff; if (xdl_do_diff(mf1, mf2, xpp, &xe) < 0) { @@ -558,6 +597,9 @@ return -1; } if (xscr) { + if (xpp->flags & XDF_IGNORE_BLANK_LINES) + xdl_mark_ignorable(xscr, &xe, xpp->flags); + if (ef(&xe, xscr, ecb, xecfg) < 0) { xdl_free_script(xscr); diff -Nru libgit2-0.22.2/src/xdiff/xdiffi.h libgit2-0.23.1/src/xdiff/xdiffi.h --- libgit2-0.22.2/src/xdiff/xdiffi.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xdiffi.h 2015-08-03 18:07:35.000000000 +0000 @@ -41,6 +41,7 @@ struct s_xdchange *next; long i1, i2; long chg1, chg2; + int ignore; } xdchange_t; diff -Nru libgit2-0.22.2/src/xdiff/xemit.c libgit2-0.23.1/src/xdiff/xemit.c --- libgit2-0.22.2/src/xdiff/xemit.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xemit.c 2015-08-03 18:07:35.000000000 +0000 @@ -56,16 +56,51 @@ /* * Starting at the passed change atom, find the latest change atom to be included * inside the differential hunk according to the specified configuration. + * Also advance xscr if the first changes must be discarded. */ -xdchange_t *xdl_get_hunk(xdchange_t *xscr, xdemitconf_t const *xecfg) { - xdchange_t *xch, *xchp; +xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg) +{ + xdchange_t *xch, *xchp, *lxch; long max_common = 2 * xecfg->ctxlen + xecfg->interhunkctxlen; + long max_ignorable = xecfg->ctxlen; + unsigned long ignored = 0; /* number of ignored blank lines */ + + /* remove ignorable changes that are too far before other changes */ + for (xchp = *xscr; xchp && xchp->ignore; xchp = xchp->next) { + xch = xchp->next; + + if (xch == NULL || + xch->i1 - (xchp->i1 + xchp->chg1) >= max_ignorable) + *xscr = xch; + } + + if (*xscr == NULL) + return NULL; + + lxch = *xscr; - for (xchp = xscr, xch = xscr->next; xch; xchp = xch, xch = xch->next) - if (xch->i1 - (xchp->i1 + xchp->chg1) > max_common) + for (xchp = *xscr, xch = xchp->next; xch; xchp = xch, xch = xch->next) { + long distance = xch->i1 - (xchp->i1 + xchp->chg1); + if (distance > max_common) break; - return xchp; + if (distance < max_ignorable && (!xch->ignore || lxch == xchp)) { + lxch = xch; + ignored = 0; + } else if (distance < max_ignorable && xch->ignore) { + ignored += xch->chg2; + } else if (lxch != xchp && + xch->i1 + ignored - (lxch->i1 + lxch->chg1) > (unsigned long)max_common) { + break; + } else if (!xch->ignore) { + lxch = xch; + ignored = 0; + } else { + ignored += xch->chg2; + } + } + + return lxch; } @@ -144,7 +179,9 @@ return xdl_emit_common(xe, xscr, ecb, xecfg); for (xch = xscr; xch; xch = xche->next) { - xche = xdl_get_hunk(xch, xecfg); + xche = xdl_get_hunk(&xch, xecfg); + if (!xch) + break; s1 = XDL_MAX(xch->i1 - xecfg->ctxlen, 0); s2 = XDL_MAX(xch->i2 - xecfg->ctxlen, 0); diff -Nru libgit2-0.22.2/src/xdiff/xemit.h libgit2-0.23.1/src/xdiff/xemit.h --- libgit2-0.22.2/src/xdiff/xemit.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xemit.h 2015-08-03 18:07:35.000000000 +0000 @@ -27,7 +27,7 @@ typedef int (*emit_func_t)(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, xdemitconf_t const *xecfg); -xdchange_t *xdl_get_hunk(xdchange_t *xscr, xdemitconf_t const *xecfg); +xdchange_t *xdl_get_hunk(xdchange_t **xscr, xdemitconf_t const *xecfg); int xdl_emit_diff(xdfenv_t *xe, xdchange_t *xscr, xdemitcb_t *ecb, xdemitconf_t const *xecfg); diff -Nru libgit2-0.22.2/src/xdiff/xhistogram.c libgit2-0.23.1/src/xdiff/xhistogram.c --- libgit2-0.22.2/src/xdiff/xhistogram.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xhistogram.c 2015-08-03 18:07:35.000000000 +0000 @@ -258,7 +258,7 @@ int line1, int count1, int line2, int count2) { xpparam_t xpp; - xpp.flags = index->xpp->flags & ~XDF_HISTOGRAM_DIFF; + xpp.flags = index->xpp->flags & ~XDF_DIFF_ALGORITHM_MASK; return xdl_fall_back_diff(index->env, &xpp, line1, count1, line2, count2); diff -Nru libgit2-0.22.2/src/xdiff/xmerge.c libgit2-0.23.1/src/xdiff/xmerge.c --- libgit2-0.22.2/src/xdiff/xmerge.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xmerge.c 2015-08-03 18:07:35.000000000 +0000 @@ -245,11 +245,11 @@ dest ? dest + size : NULL); /* Postimage from side #1 */ if (m->mode & 1) - size += xdl_recs_copy(xe1, m->i1, m->chg1, 1, + size += xdl_recs_copy(xe1, m->i1, m->chg1, (m->mode & 2), dest ? dest + size : NULL); /* Postimage from side #2 */ if (m->mode & 2) - size += xdl_recs_copy(xe2, m->i2, m->chg2, 1, + size += xdl_recs_copy(xe2, m->i2, m->chg2, 0, dest ? dest + size : NULL); } else continue; diff -Nru libgit2-0.22.2/src/xdiff/xpatience.c libgit2-0.23.1/src/xdiff/xpatience.c --- libgit2-0.22.2/src/xdiff/xpatience.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xpatience.c 2015-08-03 18:07:35.000000000 +0000 @@ -288,7 +288,7 @@ int line1, int count1, int line2, int count2) { xpparam_t xpp; - xpp.flags = map->xpp->flags & ~XDF_PATIENCE_DIFF; + xpp.flags = map->xpp->flags & ~XDF_DIFF_ALGORITHM_MASK; return xdl_fall_back_diff(map->env, &xpp, line1, count1, line2, count2); diff -Nru libgit2-0.22.2/src/xdiff/xprepare.c libgit2-0.23.1/src/xdiff/xprepare.c --- libgit2-0.22.2/src/xdiff/xprepare.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xprepare.c 2015-08-03 18:07:35.000000000 +0000 @@ -181,7 +181,7 @@ if (!(recs = (xrecord_t **) xdl_malloc(narec * sizeof(xrecord_t *)))) goto abort; - if (xpp->flags & XDF_HISTOGRAM_DIFF) + if (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF) hbits = hsize = 0; else { hbits = xdl_hashbits((unsigned int) narec); @@ -209,8 +209,8 @@ crec->ha = hav; recs[nrec++] = crec; - if (!(xpp->flags & XDF_HISTOGRAM_DIFF) && - xdl_classify_record(pass, cf, rhash, hbits, crec) < 0) + if ((XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF) && + xdl_classify_record(pass, cf, rhash, hbits, crec) < 0) goto abort; } } @@ -273,16 +273,15 @@ * (nrecs) will be updated correctly anyway by * xdl_prepare_ctx(). */ - sample = xpp->flags & XDF_HISTOGRAM_DIFF ? XDL_GUESS_NLINES2 : XDL_GUESS_NLINES1; + sample = (XDF_DIFF_ALG(xpp->flags) == XDF_HISTOGRAM_DIFF + ? XDL_GUESS_NLINES2 : XDL_GUESS_NLINES1); enl1 = xdl_guess_lines(mf1, sample) + 1; enl2 = xdl_guess_lines(mf2, sample) + 1; - if (!(xpp->flags & XDF_HISTOGRAM_DIFF) && - xdl_init_classifier(&cf, enl1 + enl2 + 1, xpp->flags) < 0) { - + if (XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF && + xdl_init_classifier(&cf, enl1 + enl2 + 1, xpp->flags) < 0) return -1; - } if (xdl_prepare_ctx(1, mf1, enl1, xpp, &cf, &xe->xdf1) < 0) { @@ -296,9 +295,9 @@ return -1; } - if (!(xpp->flags & XDF_PATIENCE_DIFF) && - !(xpp->flags & XDF_HISTOGRAM_DIFF) && - xdl_optimize_ctxs(&cf, &xe->xdf1, &xe->xdf2) < 0) { + if ((XDF_DIFF_ALG(xpp->flags) != XDF_PATIENCE_DIFF) && + (XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF) && + xdl_optimize_ctxs(&cf, &xe->xdf1, &xe->xdf2) < 0) { xdl_free_ctx(&xe->xdf2); xdl_free_ctx(&xe->xdf1); diff -Nru libgit2-0.22.2/src/xdiff/xutils.c libgit2-0.23.1/src/xdiff/xutils.c --- libgit2-0.22.2/src/xdiff/xutils.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xutils.c 2015-08-03 18:07:35.000000000 +0000 @@ -120,35 +120,6 @@ return data; } - -void *xdl_cha_first(chastore_t *cha) { - chanode_t *sncur; - - if (!(cha->sncur = sncur = cha->head)) - return NULL; - - cha->scurr = 0; - - return (char *) sncur + sizeof(chanode_t) + cha->scurr; -} - - -void *xdl_cha_next(chastore_t *cha) { - chanode_t *sncur; - - if (!(sncur = cha->sncur)) - return NULL; - cha->scurr += cha->isize; - if (cha->scurr == sncur->icurr) { - if (!(sncur = cha->sncur = sncur->next)) - return NULL; - cha->scurr = 0; - } - - return (char *) sncur + sizeof(chanode_t) + cha->scurr; -} - - long xdl_guess_lines(mmfile_t *mf, long sample) { long nl = 0, size, tsize = 0; char const *data, *cur, *top; @@ -170,6 +141,19 @@ return nl + 1; } +int xdl_blankline(const char *line, long size, long flags) +{ + long i; + + if (!(flags & XDF_WHITESPACE_FLAGS)) + return (size <= 1); + + for (i = 0; i < size && XDL_ISSPACE(line[i]); i++) + ; + + return (i == size); +} + int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags) { int i1, i2; diff -Nru libgit2-0.22.2/src/xdiff/xutils.h libgit2-0.23.1/src/xdiff/xutils.h --- libgit2-0.22.2/src/xdiff/xutils.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/xdiff/xutils.h 2015-08-03 18:07:35.000000000 +0000 @@ -34,6 +34,7 @@ void *xdl_cha_first(chastore_t *cha); void *xdl_cha_next(chastore_t *cha); long xdl_guess_lines(mmfile_t *mf, long sample); +int xdl_blankline(const char *line, long size, long flags); int xdl_recmatch(const char *l1, long s1, const char *l2, long s2, long flags); unsigned long xdl_hash_record(char const **data, char const *top, long flags); unsigned int xdl_hashbits(unsigned int size); diff -Nru libgit2-0.22.2/src/zstream.c libgit2-0.23.1/src/zstream.c --- libgit2-0.22.2/src/zstream.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/src/zstream.c 2015-08-03 18:07:35.000000000 +0000 @@ -134,7 +134,7 @@ while (!git_zstream_done(&zs)) { size_t step = git_zstream_suggest_output_len(&zs), written; - if ((error = git_buf_grow(out, out->size + step)) < 0) + if ((error = git_buf_grow_by(out, step)) < 0) goto done; written = out->asize - out->size; diff -Nru libgit2-0.22.2/tests/attr/ignore.c libgit2-0.23.1/tests/attr/ignore.c --- libgit2-0.22.2/tests/attr/ignore.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/attr/ignore.c 2015-08-03 18:07:35.000000000 +0000 @@ -146,6 +146,24 @@ assert_is_ignored(true, "NewFolder/NewFolder/File.txt"); } +void test_attr_ignore__subdirectory_gitignore(void) +{ + p_unlink("attr/.gitignore"); + cl_assert(!git_path_exists("attr/.gitignore")); + cl_git_mkfile( + "attr/.gitignore", + "file1\n"); + p_mkdir("attr/dir", 0777); + cl_git_mkfile( + "attr/dir/.gitignore", + "file2/\n"); + + assert_is_ignored(true, "file1"); + assert_is_ignored(true, "dir/file1"); + assert_is_ignored(true, "dir/file2/actual_file"); /* in ignored dir */ + assert_is_ignored(false, "dir/file3"); +} + void test_attr_ignore__expand_tilde_to_homedir(void) { git_config *cfg; @@ -173,3 +191,64 @@ assert_is_ignored(false, "example.global_with_tilde"); } + +/* Ensure that the .gitignore in the subdirectory only affects + * items in the subdirectory. */ +void test_attr_ignore__gitignore_in_subdir(void) +{ + cl_git_rmfile("attr/.gitignore"); + + cl_must_pass(p_mkdir("attr/dir1", 0777)); + cl_must_pass(p_mkdir("attr/dir1/dir2", 0777)); + cl_must_pass(p_mkdir("attr/dir1/dir2/dir3", 0777)); + + cl_git_mkfile("attr/dir1/dir2/dir3/.gitignore", "dir1/\ndir1/subdir/"); + + assert_is_ignored(false, "dir1/file"); + assert_is_ignored(false, "dir1/dir2/file"); + assert_is_ignored(false, "dir1/dir2/dir3/file"); + assert_is_ignored(true, "dir1/dir2/dir3/dir1/file"); + assert_is_ignored(true, "dir1/dir2/dir3/dir1/subdir/foo"); + + if (cl_repo_get_bool(g_repo, "core.ignorecase")) { + cl_git_mkfile("attr/dir1/dir2/dir3/.gitignore", "DiR1/\nDiR1/subdir/\n"); + + assert_is_ignored(false, "dir1/file"); + assert_is_ignored(false, "dir1/dir2/file"); + assert_is_ignored(false, "dir1/dir2/dir3/file"); + assert_is_ignored(true, "dir1/dir2/dir3/dir1/file"); + assert_is_ignored(true, "dir1/dir2/dir3/dir1/subdir/foo"); + } +} + +/* Ensure that files do not match folder cases */ +void test_attr_ignore__dont_ignore_files_for_folder(void) +{ + cl_git_rmfile("attr/.gitignore"); + + cl_git_mkfile("attr/dir/.gitignore", "test/\n"); + + /* Create "test" as a file; ensure it is not ignored. */ + cl_git_mkfile("attr/dir/test", "This is a file."); + + assert_is_ignored(false, "dir/test"); + if (cl_repo_get_bool(g_repo, "core.ignorecase")) + assert_is_ignored(false, "dir/TeSt"); + + /* Create "test" as a directory; ensure it is ignored. */ + cl_git_rmfile("attr/dir/test"); + cl_must_pass(p_mkdir("attr/dir/test", 0777)); + + assert_is_ignored(true, "dir/test"); + if (cl_repo_get_bool(g_repo, "core.ignorecase")) + assert_is_ignored(true, "dir/TeSt"); + + /* Remove "test" entirely; ensure it is not ignored. + * (As it doesn't exist, it is not a directory.) + */ + cl_must_pass(p_rmdir("attr/dir/test")); + + assert_is_ignored(false, "dir/test"); + if (cl_repo_get_bool(g_repo, "core.ignorecase")) + assert_is_ignored(false, "dir/TeSt"); +} diff -Nru libgit2-0.22.2/tests/attr/lookup.c libgit2-0.23.1/tests/attr/lookup.c --- libgit2-0.22.2/tests/attr/lookup.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/attr/lookup.c 2015-08-03 18:07:35.000000000 +0000 @@ -13,7 +13,7 @@ cl_assert_equal_s(cl_fixture("attr/attr0"), file->entry->path); cl_assert(file->rules.length == 1); - cl_git_pass(git_attr_path__init(&path, "test", NULL)); + cl_git_pass(git_attr_path__init(&path, "test", NULL, GIT_DIR_FLAG_UNKNOWN)); cl_assert_equal_s("test", path.path); cl_assert_equal_s("test", path.basename); cl_assert(!path.is_dir); @@ -36,7 +36,7 @@ int error; for (c = cases; c->path != NULL; c++) { - cl_git_pass(git_attr_path__init(&path, c->path, NULL)); + cl_git_pass(git_attr_path__init(&path, c->path, NULL, GIT_DIR_FLAG_UNKNOWN)); if (force_dir) path.is_dir = 1; @@ -133,7 +133,7 @@ cl_assert_equal_s(cl_fixture("attr/attr1"), file->entry->path); cl_assert(file->rules.length == 10); - cl_git_pass(git_attr_path__init(&path, "/testing/for/pat0", NULL)); + cl_git_pass(git_attr_path__init(&path, "/testing/for/pat0", NULL, GIT_DIR_FLAG_UNKNOWN)); cl_assert_equal_s("pat0", path.basename); run_test_cases(file, cases, 0); diff -Nru libgit2-0.22.2/tests/blame/blame_helpers.c libgit2-0.23.1/tests/blame/blame_helpers.c --- libgit2-0.22.2/tests/blame/blame_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/blame/blame_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -4,7 +4,7 @@ { va_list arglist; - printf("Hunk %zd (line %d +%d): ", idx, + printf("Hunk %"PRIuZ" (line %d +%d): ", idx, hunk->final_start_line_number, hunk->lines_in_hunk-1); va_start(arglist, fmt); diff -Nru libgit2-0.22.2/tests/buf/basic.c libgit2-0.23.1/tests/buf/basic.c --- libgit2-0.22.2/tests/buf/basic.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/buf/basic.c 2015-08-03 18:07:35.000000000 +0000 @@ -15,6 +15,28 @@ git_buf_free(&buf1); } +void test_buf_basic__resize_incremental(void) +{ + git_buf buf1 = GIT_BUF_INIT; + + /* Presently, asking for 6 bytes will round up to 8. */ + cl_git_pass(git_buf_puts(&buf1, "Hello")); + cl_assert_equal_i(5, buf1.size); + cl_assert_equal_i(8, buf1.asize); + + /* Ensure an additional byte does not realloc. */ + cl_git_pass(git_buf_grow_by(&buf1, 1)); + cl_assert_equal_i(5, buf1.size); + cl_assert_equal_i(8, buf1.asize); + + /* But requesting many does. */ + cl_git_pass(git_buf_grow_by(&buf1, 16)); + cl_assert_equal_i(5, buf1.size); + cl_assert(buf1.asize > 8); + + git_buf_free(&buf1); +} + void test_buf_basic__printf(void) { git_buf buf2 = GIT_BUF_INIT; diff -Nru libgit2-0.22.2/tests/buf/oom.c libgit2-0.23.1/tests/buf/oom.c --- libgit2-0.22.2/tests/buf/oom.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/buf/oom.c 2015-08-03 18:07:35.000000000 +0000 @@ -29,3 +29,13 @@ git_buf_free(&buf); } + +void test_buf_oom__grow_by(void) +{ + git_buf buf = GIT_BUF_INIT; + + buf.size = SIZE_MAX-10; + + cl_assert(git_buf_grow_by(&buf, 50) == -1); + cl_assert(git_buf_oom(&buf)); +} diff -Nru libgit2-0.22.2/tests/checkout/checkout_helpers.c libgit2-0.23.1/tests/checkout/checkout_helpers.c --- libgit2-0.22.2/tests/checkout/checkout_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/checkout_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,6 +2,7 @@ #include "checkout_helpers.h" #include "refs.h" #include "fileops.h" +#include "index.h" void assert_on_branch(git_repository *repo, const char *branch) { @@ -128,3 +129,23 @@ return 0; } + +void tick_index(git_index *index) +{ + git_time_t ts; + struct timeval times[2]; + + cl_assert(index->on_disk); + cl_assert(git_index_path(index)); + + cl_git_pass(git_index_read(index, true)); + ts = index->stamp.mtime; + + times[0].tv_sec = ts; + times[0].tv_usec = 0; + times[1].tv_sec = ts + 5; + times[1].tv_usec = 0; + + cl_git_pass(p_utimes(git_index_path(index), times)); + cl_git_pass(git_index_read(index, true)); +} diff -Nru libgit2-0.22.2/tests/checkout/checkout_helpers.h libgit2-0.23.1/tests/checkout/checkout_helpers.h --- libgit2-0.22.2/tests/checkout/checkout_helpers.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/checkout_helpers.h 2015-08-03 18:07:35.000000000 +0000 @@ -27,3 +27,5 @@ const git_diff_file *target, const git_diff_file *workdir, void *payload); + +extern void tick_index(git_index *index); diff -Nru libgit2-0.22.2/tests/checkout/conflict.c libgit2-0.23.1/tests/checkout/conflict.c --- libgit2-0.22.2/tests/checkout/conflict.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/conflict.c 2015-08-03 18:07:35.000000000 +0000 @@ -102,7 +102,7 @@ memset(&entry, 0x0, sizeof(git_index_entry)); entry.mode = entries[i].mode; - entry.flags = entries[i].stage << GIT_IDXENTRY_STAGESHIFT; + GIT_IDXENTRY_STAGE_SET(&entry, entries[i].stage); git_oid_fromstr(&entry.id, entries[i].oid_str); entry.path = entries[i].path; @@ -161,7 +161,10 @@ static void ensure_workdir_mode(const char *path, int mode) { -#ifndef GIT_WIN32 +#ifdef GIT_WIN32 + GIT_UNUSED(path); + GIT_UNUSED(mode); +#else git_buf fullpath = GIT_BUF_INIT; struct stat st; diff -Nru libgit2-0.22.2/tests/checkout/crlf.c libgit2-0.23.1/tests/checkout/crlf.c --- libgit2-0.22.2/tests/checkout/crlf.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/crlf.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,109 +1,254 @@ #include "clar_libgit2.h" #include "checkout_helpers.h" #include "../filter/crlf.h" +#include "fileops.h" #include "git2/checkout.h" #include "repository.h" +#include "index.h" #include "posix.h" static git_repository *g_repo; +static const char *systype; +static git_buf expected_fixture = GIT_BUF_INIT; + void test_checkout_crlf__initialize(void) { g_repo = cl_git_sandbox_init("crlf"); + + if (GIT_EOL_NATIVE == GIT_EOL_CRLF) + systype = "windows"; + else + systype = "posix"; } void test_checkout_crlf__cleanup(void) { cl_git_sandbox_cleanup(); + + if (expected_fixture.size) { + cl_fixture_cleanup(expected_fixture.ptr); + git_buf_free(&expected_fixture); + } } -void test_checkout_crlf__detect_crlf_autocrlf_false(void) +struct compare_data { - git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + const char *dirname; + const char *autocrlf; + const char *attrs; +}; + +static int compare_file(void *payload, git_buf *actual_path) +{ + git_buf expected_path = GIT_BUF_INIT; + git_buf actual_contents = GIT_BUF_INIT; + git_buf expected_contents = GIT_BUF_INIT; + struct compare_data *cd = payload; + bool failed = true; + int cmp_git, cmp_gitattributes; + char *basename; + + basename = git_path_basename(actual_path->ptr); + cmp_git = strcmp(basename, ".git"); + cmp_gitattributes = strcmp(basename, ".gitattributes"); + + if (cmp_git == 0 || cmp_gitattributes == 0) { + failed = false; + goto done; + } - cl_repo_set_bool(g_repo, "core.autocrlf", false); + cl_git_pass(git_buf_joinpath(&expected_path, cd->dirname, basename)); - git_checkout_head(g_repo, &opts); + if (!git_path_isfile(expected_path.ptr) || + !git_path_isfile(actual_path->ptr)) + goto done; + + if (git_futils_readbuffer(&actual_contents, actual_path->ptr) < 0 || + git_futils_readbuffer(&expected_contents, expected_path.ptr) < 0) + goto done; + + if (actual_contents.size != expected_contents.size) + goto done; + + if (memcmp(actual_contents.ptr, expected_contents.ptr, expected_contents.size) != 0) + goto done; + + failed = false; + +done: + if (failed) { + git_buf details = GIT_BUF_INIT; + git_buf_printf(&details, "filename=%s, system=%s, autocrlf=%s, attrs={%s}", + git_path_basename(actual_path->ptr), systype, cd->autocrlf, cd->attrs); + clar__fail(__FILE__, __LINE__, + "checked out contents did not match expected", details.ptr, 0); + git_buf_free(&details); + } - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); - check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); + git__free(basename); + git_buf_free(&expected_contents); + git_buf_free(&actual_contents); + git_buf_free(&expected_path); + + return 0; } -void test_checkout_crlf__autocrlf_false_index_size_is_unfiltered_size(void) +static void test_checkout(const char *autocrlf, const char *attrs) { - git_index *index; - const git_index_entry *entry; + git_buf attrbuf = GIT_BUF_INIT; + git_buf expected_dirname = GIT_BUF_INIT; + git_buf sandboxname = GIT_BUF_INIT; + git_buf reponame = GIT_BUF_INIT; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + struct compare_data compare_data = { NULL, autocrlf, attrs }; + const char *c; - cl_repo_set_bool(g_repo, "core.autocrlf", false); + git_buf_puts(&reponame, "crlf"); + + git_buf_puts(&sandboxname, "autocrlf_"); + git_buf_puts(&sandboxname, autocrlf); + + if (*attrs) { + git_buf_puts(&sandboxname, ","); + for (c = attrs; *c; c++) { + if (*c == ' ') + git_buf_putc(&sandboxname, ','); + else if (*c == '=') + git_buf_putc(&sandboxname, '_'); + else + git_buf_putc(&sandboxname, *c); + } + + git_buf_printf(&attrbuf, "* %s\n", attrs); + cl_git_mkfile("crlf/.gitattributes", attrbuf.ptr); + } + + cl_repo_set_string(g_repo, "core.autocrlf", autocrlf); + + git_buf_joinpath(&expected_dirname, systype, sandboxname.ptr); + git_buf_joinpath(&expected_fixture, "crlf_data", expected_dirname.ptr); + cl_fixture_sandbox(expected_fixture.ptr); + + opts.checkout_strategy = GIT_CHECKOUT_FORCE; git_checkout_head(g_repo, &opts); - git_repository_index(&index, g_repo); + compare_data.dirname = sandboxname.ptr; + cl_git_pass(git_path_direach(&reponame, 0, compare_file, &compare_data)); - cl_assert((entry = git_index_get_bypath(index, "all-lf", 0)) != NULL); - cl_assert(entry->file_size == strlen(ALL_LF_TEXT_RAW)); + cl_fixture_cleanup(expected_fixture.ptr); + git_buf_free(&expected_fixture); - cl_assert((entry = git_index_get_bypath(index, "all-crlf", 0)) != NULL); - cl_assert(entry->file_size == strlen(ALL_CRLF_TEXT_RAW)); + git_buf_free(&attrbuf); + git_buf_free(&expected_fixture); + git_buf_free(&expected_dirname); + git_buf_free(&sandboxname); + git_buf_free(&reponame); +} - git_index_free(index); +static void empty_workdir(const char *name) +{ + git_vector contents = GIT_VECTOR_INIT; + size_t i; + const char *fn; + + git_path_dirload(&contents, name, 0, 0); + git_vector_foreach(&contents, i, fn) { + char *basename = git_path_basename(fn); + int cmp = strncasecmp(basename, ".git", 4); + + git__free(basename); + + if (cmp == 0) + continue; + p_unlink(fn); + } + git_vector_free_deep(&contents); } -void test_checkout_crlf__detect_crlf_autocrlf_true(void) +void test_checkout_crlf__matches_core_git(void) +{ + const char *autocrlf[] = { "true", "false", "input", NULL }; + const char *attrs[] = { "", "-crlf", "-text", "eol=crlf", "eol=lf", + "text", "text eol=crlf", "text eol=lf", + "text=auto", "text=auto eol=crlf", "text=auto eol=lf", + NULL }; + const char **a, **b; + + for (a = autocrlf; *a; a++) { + for (b = attrs; *b; b++) { + empty_workdir("crlf"); + test_checkout(*a, *b); + } + } +} + +void test_checkout_crlf__detect_crlf_autocrlf_false(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; - cl_repo_set_bool(g_repo, "core.autocrlf", true); + cl_repo_set_bool(g_repo, "core.autocrlf", false); git_checkout_head(g_repo, &opts); - if (GIT_EOL_NATIVE == GIT_EOL_LF) - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); - else - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF); - + check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); } -void test_checkout_crlf__more_lf_autocrlf_true(void) +void test_checkout_crlf__autocrlf_false_index_size_is_unfiltered_size(void) { + git_index *index; + const git_index_entry *entry; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; - cl_repo_set_bool(g_repo, "core.autocrlf", true); + cl_repo_set_bool(g_repo, "core.autocrlf", false); + + git_repository_index(&index, g_repo); + tick_index(index); git_checkout_head(g_repo, &opts); - check_file_contents("./crlf/more-lf", MORE_LF_TEXT_RAW); + cl_assert((entry = git_index_get_bypath(index, "all-lf", 0)) != NULL); + cl_assert(entry->file_size == strlen(ALL_LF_TEXT_RAW)); + + cl_assert((entry = git_index_get_bypath(index, "all-crlf", 0)) != NULL); + cl_assert(entry->file_size == strlen(ALL_CRLF_TEXT_RAW)); + + git_index_free(index); } -void test_checkout_crlf__more_crlf_autocrlf_true(void) +void test_checkout_crlf__detect_crlf_autocrlf_true(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_repo_set_bool(g_repo, "core.autocrlf", true); git_checkout_head(g_repo, &opts); - check_file_contents("./crlf/more-crlf", MORE_CRLF_TEXT_RAW); + check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF); + check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); } -void test_checkout_crlf__all_crlf_autocrlf_true(void) +void test_checkout_crlf__detect_crlf_autocrlf_true_utf8(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_repo_set_bool(g_repo, "core.autocrlf", true); + git_repository_set_head(g_repo, "refs/heads/master"); git_checkout_head(g_repo, &opts); - check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); + check_file_contents("./crlf/few-utf8-chars-lf", FEW_UTF8_CRLF_RAW); + check_file_contents("./crlf/many-utf8-chars-lf", MANY_UTF8_CRLF_RAW); + + check_file_contents("./crlf/few-utf8-chars-crlf", FEW_UTF8_CRLF_RAW); + check_file_contents("./crlf/many-utf8-chars-crlf", MANY_UTF8_CRLF_RAW); } void test_checkout_crlf__autocrlf_true_index_size_is_filtered_size(void) @@ -111,20 +256,18 @@ git_index *index; const git_index_entry *entry; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_repo_set_bool(g_repo, "core.autocrlf", true); - git_checkout_head(g_repo, &opts); - git_repository_index(&index, g_repo); + tick_index(index); + + git_checkout_head(g_repo, &opts); cl_assert((entry = git_index_get_bypath(index, "all-lf", 0)) != NULL); - if (GIT_EOL_NATIVE == GIT_EOL_LF) - cl_assert_equal_sz(strlen(ALL_LF_TEXT_RAW), entry->file_size); - else - cl_assert_equal_sz(strlen(ALL_LF_TEXT_AS_CRLF), entry->file_size); + cl_assert_equal_sz(strlen(ALL_LF_TEXT_AS_CRLF), entry->file_size); cl_assert((entry = git_index_get_bypath(index, "all-crlf", 0)) != NULL); cl_assert_equal_sz(strlen(ALL_CRLF_TEXT_RAW), entry->file_size); @@ -137,7 +280,7 @@ git_index *index; git_blob *blob; git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_git_mkfile("crlf/.gitattributes", "*.txt text\n*.bin binary\n" @@ -193,32 +336,21 @@ git_checkout_head(g_repo, &opts); - if (GIT_EOL_NATIVE == GIT_EOL_LF) { - cl_assert_equal_file( - ALL_LF_TEXT_RAW - "\n$Id: fcf6d4d9c212dc66563b1171b1cd99953c756467$\n", - 0, "crlf/lf.ident"); - cl_assert_equal_file( - ALL_CRLF_TEXT_AS_LF - "\n$Id: f2c66ad9b2b5a734d9bf00d5000cc10a62b8a857$\n\n", - 0, "crlf/crlf.ident"); - } else { - cl_assert_equal_file( - ALL_LF_TEXT_AS_CRLF - "\r\n$Id: fcf6d4d9c212dc66563b1171b1cd99953c756467$\r\n", - 0, "crlf/lf.ident"); - cl_assert_equal_file( - ALL_CRLF_TEXT_RAW - "\r\n$Id: f2c66ad9b2b5a734d9bf00d5000cc10a62b8a857$\r\n\r\n", - 0, "crlf/crlf.ident"); - } + cl_assert_equal_file( + ALL_LF_TEXT_AS_CRLF + "\r\n$Id: fcf6d4d9c212dc66563b1171b1cd99953c756467 $\r\n", + 0, "crlf/lf.ident"); + cl_assert_equal_file( + ALL_CRLF_TEXT_RAW + "\r\n$Id: f2c66ad9b2b5a734d9bf00d5000cc10a62b8a857 $\r\n\r\n", + 0, "crlf/crlf.ident"); cl_assert_equal_file( - "$Id: f7830382dac1f1583422be5530fdfbd26289431b$\n" + "$Id: f7830382dac1f1583422be5530fdfbd26289431b $\n" MORE_LF_TEXT_AS_LF, 0, "crlf/more1.identlf"); cl_assert_equal_file( - "\r\n$Id: 74677a68413012ce8d7e7cfc3f12603df3a3eac4$\r\n" + "\r\n$Id: 74677a68413012ce8d7e7cfc3f12603df3a3eac4 $\r\n" MORE_CRLF_TEXT_AS_CRLF, 0, "crlf/more2.identcrlf"); git_index_free(index); @@ -227,7 +359,7 @@ void test_checkout_crlf__autocrlf_false_no_attrs(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_repo_set_bool(g_repo, "core.autocrlf", false); @@ -240,25 +372,20 @@ void test_checkout_crlf__autocrlf_true_no_attrs(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_repo_set_bool(g_repo, "core.autocrlf", true); git_checkout_head(g_repo, &opts); - if (GIT_EOL_NATIVE == GIT_EOL_CRLF) { - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF); - check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_AS_CRLF); - } else { - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); - check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); - } + check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF); + check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_AS_CRLF); } void test_checkout_crlf__autocrlf_input_no_attrs(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_repo_set_string(g_repo, "core.autocrlf", "input"); @@ -271,7 +398,7 @@ void test_checkout_crlf__autocrlf_false_text_auto_attr(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_git_mkfile("./crlf/.gitattributes", "* text=auto\n"); @@ -291,7 +418,7 @@ void test_checkout_crlf__autocrlf_true_text_auto_attr(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_git_mkfile("./crlf/.gitattributes", "* text=auto\n"); @@ -299,19 +426,14 @@ git_checkout_head(g_repo, &opts); - if (GIT_EOL_NATIVE == GIT_EOL_CRLF) { - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF); - check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_AS_CRLF); - } else { - check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); - check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); - } + check_file_contents("./crlf/all-lf", ALL_LF_TEXT_AS_CRLF); + check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_AS_CRLF); } void test_checkout_crlf__autocrlf_input_text_auto_attr(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; cl_git_mkfile("./crlf/.gitattributes", "* text=auto\n"); @@ -322,3 +444,20 @@ check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); } + +void test_checkout_crlf__can_write_empty_file(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; + + cl_repo_set_bool(g_repo, "core.autocrlf", true); + + git_repository_set_head(g_repo, "refs/heads/empty-files"); + git_checkout_head(g_repo, &opts); + + check_file_contents("./crlf/test1.txt", ""); + + check_file_contents("./crlf/test2.txt", "test2.txt's content\r\n"); + + check_file_contents("./crlf/test3.txt", ""); +} diff -Nru libgit2-0.22.2/tests/checkout/icase.c libgit2-0.23.1/tests/checkout/icase.c --- libgit2-0.22.2/tests/checkout/icase.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/icase.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,10 +1,13 @@ #include "clar_libgit2.h" #include "git2/checkout.h" +#include "refs.h" #include "path.h" #ifdef GIT_WIN32 # include +#else +# include #endif static git_repository *repo; @@ -14,14 +17,23 @@ void test_checkout_icase__initialize(void) { git_oid id; + git_config *cfg; + int icase = 0; repo = cl_git_sandbox_init("testrepo"); + cl_git_pass(git_repository_config_snapshot(&cfg, repo)); + git_config_get_bool(&icase, cfg, "core.ignorecase"); + git_config_free(cfg); + + if (!icase) + cl_skip(); + cl_git_pass(git_reference_name_to_id(&id, repo, "refs/heads/dir")); cl_git_pass(git_object_lookup(&obj, repo, &id, GIT_OBJ_ANY)); git_checkout_init_options(&checkout_opts, GIT_CHECKOUT_OPTIONS_VERSION); - checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE; } void test_checkout_icase__cleanup(void) @@ -30,7 +42,7 @@ cl_git_sandbox_cleanup(); } -static char *test_realpath(const char *in) +static char *get_filename(const char *in) { #ifdef GIT_WIN32 HANDLE fh; @@ -55,7 +67,31 @@ return filename; #else - return realpath(in, NULL); + char *search_dirname, *search_filename, *filename = NULL; + git_buf out = GIT_BUF_INIT; + DIR *dir; + struct dirent *de; + + cl_assert(search_dirname = git_path_dirname(in)); + cl_assert(search_filename = git_path_basename(in)); + + cl_assert(dir = opendir(search_dirname)); + + while ((de = readdir(dir))) { + if (strcasecmp(de->d_name, search_filename) == 0) { + git_buf_join(&out, '/', search_dirname, de->d_name); + filename = git_buf_detach(&out); + break; + } + } + + closedir(dir); + + git__free(search_dirname); + git__free(search_filename); + git_buf_free(&out); + + return filename; #endif } @@ -64,7 +100,7 @@ char *actual; size_t actual_len, expected_len, start; - cl_assert(actual = test_realpath(expected)); + cl_assert(actual = get_filename(expected)); expected_len = strlen(expected); actual_len = strlen(actual); @@ -79,8 +115,21 @@ free(actual); } -void test_checkout_icase__overwrites_files_for_files(void) +void test_checkout_icase__refuses_to_overwrite_files_for_files(void) +{ + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE|GIT_CHECKOUT_RECREATE_MISSING; + + cl_git_write2file("testrepo/BRANCH_FILE.txt", "neue file\n", 10, \ + O_WRONLY | O_CREAT | O_TRUNC, 0644); + + cl_git_fail(git_checkout_tree(repo, obj, &checkout_opts)); + assert_name_is("testrepo/BRANCH_FILE.txt"); +} + +void test_checkout_icase__overwrites_files_for_files_when_forced(void) { + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + cl_git_write2file("testrepo/NEW.txt", "neue file\n", 10, \ O_WRONLY | O_CREAT | O_TRUNC, 0644); @@ -88,8 +137,22 @@ assert_name_is("testrepo/new.txt"); } -void test_checkout_icase__overwrites_links_for_files(void) +void test_checkout_icase__refuses_to_overwrite_links_for_files(void) +{ + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE|GIT_CHECKOUT_RECREATE_MISSING; + + cl_must_pass(p_symlink("../tmp", "testrepo/BRANCH_FILE.txt")); + + cl_git_fail(git_checkout_tree(repo, obj, &checkout_opts)); + + cl_assert(!git_path_exists("tmp")); + assert_name_is("testrepo/BRANCH_FILE.txt"); +} + +void test_checkout_icase__overwrites_links_for_files_when_forced(void) { + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + cl_must_pass(p_symlink("../tmp", "testrepo/NEW.txt")); cl_git_pass(git_checkout_tree(repo, obj, &checkout_opts)); @@ -98,9 +161,39 @@ assert_name_is("testrepo/new.txt"); } -void test_checkout_icase__overwites_folders_for_files(void) +void test_checkout_icase__overwrites_empty_folders_for_files(void) +{ + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE|GIT_CHECKOUT_RECREATE_MISSING; + + cl_must_pass(p_mkdir("testrepo/NEW.txt", 0777)); + + cl_git_pass(git_checkout_tree(repo, obj, &checkout_opts)); + + assert_name_is("testrepo/new.txt"); + cl_assert(!git_path_isdir("testrepo/new.txt")); +} + +void test_checkout_icase__refuses_to_overwrite_populated_folders_for_files(void) +{ + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE|GIT_CHECKOUT_RECREATE_MISSING; + + cl_must_pass(p_mkdir("testrepo/BRANCH_FILE.txt", 0777)); + cl_git_write2file("testrepo/BRANCH_FILE.txt/foobar", "neue file\n", 10, \ + O_WRONLY | O_CREAT | O_TRUNC, 0644); + + cl_git_fail(git_checkout_tree(repo, obj, &checkout_opts)); + + assert_name_is("testrepo/BRANCH_FILE.txt"); + cl_assert(git_path_isdir("testrepo/BRANCH_FILE.txt")); +} + +void test_checkout_icase__overwrites_folders_for_files_when_forced(void) { + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + cl_must_pass(p_mkdir("testrepo/NEW.txt", 0777)); + cl_git_write2file("testrepo/NEW.txt/foobar", "neue file\n", 10, \ + O_WRONLY | O_CREAT | O_TRUNC, 0644); cl_git_pass(git_checkout_tree(repo, obj, &checkout_opts)); @@ -108,8 +201,22 @@ cl_assert(!git_path_isdir("testrepo/new.txt")); } -void test_checkout_icase__overwrites_files_for_folders(void) +void test_checkout_icase__refuses_to_overwrite_files_for_folders(void) +{ + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE|GIT_CHECKOUT_RECREATE_MISSING; + + cl_git_write2file("testrepo/A", "neue file\n", 10, \ + O_WRONLY | O_CREAT | O_TRUNC, 0644); + + cl_git_fail(git_checkout_tree(repo, obj, &checkout_opts)); + assert_name_is("testrepo/A"); + cl_assert(!git_path_isdir("testrepo/A")); +} + +void test_checkout_icase__overwrites_files_for_folders_when_forced(void) { + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + cl_git_write2file("testrepo/A", "neue file\n", 10, \ O_WRONLY | O_CREAT | O_TRUNC, 0644); @@ -118,8 +225,22 @@ cl_assert(git_path_isdir("testrepo/a")); } -void test_checkout_icase__overwrites_links_for_folders(void) +void test_checkout_icase__refuses_to_overwrite_links_for_folders(void) +{ + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE|GIT_CHECKOUT_RECREATE_MISSING; + + cl_must_pass(p_symlink("..", "testrepo/A")); + + cl_git_fail(git_checkout_tree(repo, obj, &checkout_opts)); + + cl_assert(!git_path_exists("b.txt")); + assert_name_is("testrepo/A"); +} + +void test_checkout_icase__overwrites_links_for_folders_when_forced(void) { + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + cl_must_pass(p_symlink("..", "testrepo/A")); cl_git_pass(git_checkout_tree(repo, obj, &checkout_opts)); @@ -128,3 +249,55 @@ assert_name_is("testrepo/a"); } +void test_checkout_icase__ignores_unstaged_casechange(void) +{ + git_reference *orig_ref, *br2_ref; + git_commit *orig, *br2; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; + + cl_git_pass(git_reference_lookup_resolved(&orig_ref, repo, "HEAD", 100)); + cl_git_pass(git_commit_lookup(&orig, repo, git_reference_target(orig_ref))); + cl_git_pass(git_reset(repo, (git_object *)orig, GIT_RESET_HARD, NULL)); + + cl_rename("testrepo/branch_file.txt", "testrepo/Branch_File.txt"); + + cl_git_pass(git_reference_lookup_resolved(&br2_ref, repo, "refs/heads/br2", 100)); + cl_git_pass(git_commit_lookup(&br2, repo, git_reference_target(br2_ref))); + + cl_git_pass(git_checkout_tree(repo, (const git_object *)br2, &checkout_opts)); + + git_commit_free(orig); + git_commit_free(br2); + git_reference_free(orig_ref); + git_reference_free(br2_ref); +} + +void test_checkout_icase__conflicts_with_casechanged_subtrees(void) +{ + git_reference *orig_ref; + git_object *orig, *subtrees; + git_oid oid; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; + + cl_git_pass(git_reference_lookup_resolved(&orig_ref, repo, "HEAD", 100)); + cl_git_pass(git_object_lookup(&orig, repo, git_reference_target(orig_ref), GIT_OBJ_COMMIT)); + cl_git_pass(git_reset(repo, (git_object *)orig, GIT_RESET_HARD, NULL)); + + cl_must_pass(p_mkdir("testrepo/AB", 0777)); + cl_must_pass(p_mkdir("testrepo/AB/C", 0777)); + cl_git_write2file("testrepo/AB/C/3.txt", "Foobar!\n", 8, O_RDWR|O_CREAT, 0666); + + cl_git_pass(git_reference_name_to_id(&oid, repo, "refs/heads/subtrees")); + cl_git_pass(git_object_lookup(&subtrees, repo, &oid, GIT_OBJ_ANY)); + + cl_git_fail(git_checkout_tree(repo, subtrees, &checkout_opts)); + + git_object_free(orig); + git_object_free(subtrees); + git_reference_free(orig_ref); +} + diff -Nru libgit2-0.22.2/tests/checkout/index.c libgit2-0.23.1/tests/checkout/index.c --- libgit2-0.22.2/tests/checkout/index.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/index.c 2015-08-03 18:07:35.000000000 +0000 @@ -4,6 +4,7 @@ #include "git2/checkout.h" #include "fileops.h" #include "repository.h" +#include "remote.h" static git_repository *g_repo; @@ -49,7 +50,7 @@ cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt")); cl_assert_equal_i(false, git_path_isfile("./testrepo/new.txt")); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -69,7 +70,9 @@ cl_assert_equal_i(true, git_path_isdir("./testrepo/dir/subdir/subsubdir")); opts.checkout_strategy = - GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_REMOVE_UNTRACKED; + GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING | + GIT_CHECKOUT_REMOVE_UNTRACKED; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -88,7 +91,7 @@ cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt")); cl_assert_equal_i(false, git_path_isfile("./testrepo/new.txt")); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -107,7 +110,7 @@ cl_git_mkfile("./testrepo/.gitattributes", attributes); cl_repo_set_bool(g_repo, "core.autocrlf", false); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -125,7 +128,7 @@ cl_git_pass(p_unlink("./testrepo/.gitattributes")); cl_repo_set_bool(g_repo, "core.autocrlf", true); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -133,13 +136,57 @@ #endif } +void test_checkout_index__honor_coresymlinks_default(void) +{ + git_repository *repo; + git_remote *origin; + git_object *target; + char cwd[GIT_PATH_MAX]; + + const char *url = git_repository_path(g_repo); + + cl_assert(getcwd(cwd, sizeof(cwd)) != NULL); + cl_assert_equal_i(0, p_mkdir("readonly", 0555)); // Read-only directory + cl_assert_equal_i(0, chdir("readonly")); + cl_git_pass(git_repository_init(&repo, "../symlink.git", true)); + cl_assert_equal_i(0, chdir(cwd)); + cl_assert_equal_i(0, p_mkdir("symlink", 0777)); + cl_git_pass(git_repository_set_workdir(repo, "symlink", 1)); + + cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); + cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + git_remote_free(origin); + + cl_git_pass(git_revparse_single(&target, repo, "remotes/origin/master")); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); + git_object_free(target); + git_repository_free(repo); + +#ifdef GIT_WIN32 + check_file_contents("./symlink/link_to_new.txt", "new.txt"); +#else + { + char link_data[1024]; + size_t link_size = 1024; + + link_size = p_readlink("./symlink/link_to_new.txt", link_data, link_size); + link_data[link_size] = '\0'; + cl_assert_equal_i(link_size, strlen("new.txt")); + cl_assert_equal_s(link_data, "new.txt"); + check_file_contents("./symlink/link_to_new.txt", "my new file\n"); + } +#endif + + cl_fixture_cleanup("symlink"); +} + void test_checkout_index__honor_coresymlinks_setting_set_to_true(void) { git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_repo_set_bool(g_repo, "core.symlinks", true); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -165,7 +212,7 @@ cl_repo_set_bool(g_repo, "core.symlinks", false); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -207,7 +254,7 @@ cl_git_mkfile("./testrepo/.gitattributes", "*.txt text eol=crlf\n"); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; opts.disable_filters = false; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -238,7 +285,7 @@ reset_index_to_treeish((git_object *)commit); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; opts.dir_mode = 0701; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -264,7 +311,7 @@ if (!cl_is_chmod_supported()) return; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; opts.file_mode = 0700; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -329,8 +376,9 @@ data.file = "new.txt"; data.sha = "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd"; - opts.checkout_strategy = - GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_ALLOW_CONFLICTS; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING | + GIT_CHECKOUT_ALLOW_CONFLICTS; opts.notify_flags = GIT_CHECKOUT_NOTIFY_CONFLICT; opts.notify_cb = test_checkout_notify_cb; opts.notify_payload = &data; @@ -368,7 +416,9 @@ cl_git_mkfile("./testrepo/new.txt", "my new file\r\n"); opts.checkout_strategy = - GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_ALLOW_CONFLICTS; + GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING | + GIT_CHECKOUT_ALLOW_CONFLICTS; opts.notify_flags = GIT_CHECKOUT_NOTIFY_CONFLICT; opts.notify_cb = dont_notify_cb; opts.notify_payload = NULL; @@ -388,7 +438,7 @@ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; int calls = 0; - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; opts.progress_cb = checkout_progress_counter; opts.progress_payload = &calls; @@ -423,7 +473,9 @@ cl_assert(git_path_isfile("./testrepo/path0/file0")); opts.checkout_strategy = - GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_ALLOW_CONFLICTS; + GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING | + GIT_CHECKOUT_ALLOW_CONFLICTS; cl_git_pass(git_checkout_index(g_repo, index, &opts)); cl_assert(git_path_isfile("./testrepo/path1")); @@ -473,7 +525,9 @@ cl_git_pass(p_mkdir("./testrepo/branch_file.txt.after", 0777)); opts.checkout_strategy = - GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_REMOVE_UNTRACKED; + GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING | + GIT_CHECKOUT_REMOVE_UNTRACKED; cl_git_pass(git_checkout_index(g_repo, NULL, &opts)); @@ -523,7 +577,8 @@ checkout_counts cts; memset(&cts, 0, sizeof(cts)); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING; opts.target_directory = "alternative"; cl_assert(!git_path_isdir("alternative")); @@ -568,7 +623,8 @@ cl_git_pass(git_index_write(index)); git_index_free(index); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING; opts.notify_flags = GIT_CHECKOUT_NOTIFY_ALL; opts.notify_cb = checkout_count_callback; @@ -606,7 +662,7 @@ cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt")); cl_assert_equal_i(false, git_path_isfile("./testrepo/new.txt")); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_RECREATE_MISSING; cl_git_pass(git_repository_index(&index, g_repo)); @@ -629,15 +685,15 @@ entry.path = path; git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46"); - entry.flags = (1 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 1); cl_git_pass(git_index_add(index, &entry)); git_oid_fromstr(&entry.id, "4e886e602529caa9ab11d71f86634bd1b6e0de10"); - entry.flags = (2 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 2); cl_git_pass(git_index_add(index, &entry)); git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); - entry.flags = (3 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 3); cl_git_pass(git_index_add(index, &entry)); } diff -Nru libgit2-0.22.2/tests/checkout/tree.c libgit2-0.23.1/tests/checkout/tree.c --- libgit2-0.22.2/tests/checkout/tree.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/tree.c 2015-08-03 18:07:35.000000000 +0000 @@ -15,7 +15,7 @@ g_repo = cl_git_sandbox_init("testrepo"); GIT_INIT_STRUCTURE(&g_opts, GIT_CHECKOUT_OPTIONS_VERSION); - g_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + g_opts.checkout_strategy = GIT_CHECKOUT_FORCE; } void test_checkout_tree__cleanup(void) @@ -63,7 +63,7 @@ cl_git_pass(git_revparse_single(&g_object, g_repo, "subtrees")); cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees")); cl_assert_equal_i(true, git_path_isdir("./testrepo/ab/")); cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt")); @@ -78,7 +78,7 @@ cl_git_pass(git_revparse_single(&g_object, g_repo, "master")); cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master")); /* This directory should no longer exist */ cl_assert_equal_i(false, git_path_isdir("./testrepo/ab/")); @@ -163,7 +163,7 @@ cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir")); cl_assert(git_path_isfile("testrepo/README")); cl_assert(git_path_isfile("testrepo/branch_file.txt")); @@ -183,7 +183,7 @@ cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees")); cl_assert(git_path_isfile("testrepo/README")); cl_assert(git_path_isfile("testrepo/branch_file.txt")); @@ -253,7 +253,7 @@ cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir")); cl_assert(git_path_isfile("testrepo/README")); cl_assert(git_path_isfile("testrepo/branch_file.txt")); @@ -306,14 +306,14 @@ cl_git_fail(error = checkout_tree_with_blob_ignored_in_workdir( GIT_CHECKOUT_SAFE | GIT_CHECKOUT_DONT_OVERWRITE_IGNORED, false)); - cl_assert_equal_i(GIT_EMERGECONFLICT, error); + cl_assert_equal_i(GIT_ECONFLICT, error); } void test_checkout_tree__can_overwrite_ignored_by_default(void) { cl_git_pass(checkout_tree_with_blob_ignored_in_workdir(GIT_CHECKOUT_SAFE, false)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees")); cl_assert(git_path_isfile("testrepo/ab/4.txt")); @@ -327,14 +327,14 @@ cl_git_fail(error = checkout_tree_with_blob_ignored_in_workdir( GIT_CHECKOUT_SAFE | GIT_CHECKOUT_DONT_OVERWRITE_IGNORED, true)); - cl_assert_equal_i(GIT_EMERGECONFLICT, error); + cl_assert_equal_i(GIT_ECONFLICT, error); } void test_checkout_tree__can_overwrite_ignored_folder_by_default(void) { cl_git_pass(checkout_tree_with_blob_ignored_in_workdir(GIT_CHECKOUT_SAFE, true)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees")); cl_assert(git_path_isfile("testrepo/ab/4.txt")); @@ -367,7 +367,7 @@ cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir")); assert_on_branch(g_repo, "dir"); @@ -396,7 +396,7 @@ cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts)); cl_git_pass( - git_repository_set_head_detached(g_repo, git_object_id(g_object), NULL, NULL)); + git_repository_set_head_detached(g_repo, git_object_id(g_object))); git_object_free(g_object); g_object = NULL; @@ -408,7 +408,7 @@ /* now to a narrow patterned checkout */ - g_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + g_opts.checkout_strategy = GIT_CHECKOUT_SAFE; g_opts.paths.strings = entries; g_opts.paths.count = 1; @@ -435,7 +435,7 @@ cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts)); cl_git_pass( - git_repository_set_head_detached(g_repo, git_object_id(g_object), NULL, NULL)); + git_repository_set_head_detached(g_repo, git_object_id(g_object))); git_object_free(g_object); g_object = NULL; @@ -445,7 +445,8 @@ /* now to a narrow patterned checkout, but disable pattern */ g_opts.checkout_strategy = - GIT_CHECKOUT_SAFE_CREATE | GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH; + GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH; g_opts.paths.strings = entries; g_opts.paths.count = 1; @@ -457,7 +458,7 @@ /* let's try that again, but allow the pattern match */ - g_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + g_opts.checkout_strategy = GIT_CHECKOUT_SAFE; cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts)); @@ -480,11 +481,11 @@ /* Create a branch pointing at the parent */ cl_git_pass(git_revparse_single(&g_object, g_repo, parent_sha)); cl_git_pass(git_branch_create(&branch, g_repo, - "potential_conflict", (git_commit *)g_object, 0, NULL, NULL)); + "potential_conflict", (git_commit *)g_object, 0)); /* Make HEAD point to this branch */ cl_git_pass(git_reference_symbolic_create( - &head, g_repo, "HEAD", git_reference_name(branch), 1, NULL, NULL)); + &head, g_repo, "HEAD", git_reference_name(branch), 1, NULL)); git_reference_free(head); git_reference_free(branch); @@ -511,7 +512,7 @@ g_opts.checkout_strategy = GIT_CHECKOUT_SAFE; cl_assert_equal_i( - GIT_EMERGECONFLICT, git_checkout_tree(g_repo, g_object, &g_opts)); + GIT_ECONFLICT, git_checkout_tree(g_repo, g_object, &g_opts)); /* Stage the conflicting change */ cl_git_pass(git_index_add_bypath(index, entry_path)); @@ -519,10 +520,10 @@ git_index_free(index); cl_assert_equal_i( - GIT_EMERGECONFLICT, git_checkout_tree(g_repo, g_object, &g_opts)); + GIT_ECONFLICT, git_checkout_tree(g_repo, g_object, &g_opts)); } -void test_checkout_tree__checking_out_a_conflicting_type_change_returns_EMERGECONFLICT(void) +void test_checkout_tree__checking_out_a_conflicting_type_change_returns_ECONFLICT(void) { /* * 099faba adds a symlink named 'link_to_new.txt' @@ -532,7 +533,7 @@ assert_conflict("link_to_new.txt", "old.txt", "a65fedf", "099faba"); } -void test_checkout_tree__checking_out_a_conflicting_type_change_returns_EMERGECONFLICT_2(void) +void test_checkout_tree__checking_out_a_conflicting_type_change_returns_ECONFLICT_2(void) { /* * cf80f8d adds a directory named 'a/' @@ -542,7 +543,7 @@ assert_conflict("a", "hello\n", "a4a7dce", "cf80f8d"); } -void test_checkout_tree__checking_out_a_conflicting_content_change_returns_EMERGECONFLICT(void) +void test_checkout_tree__checking_out_a_conflicting_content_change_returns_ECONFLICT(void) { /* * c47800c adds a symlink named 'branch_file.txt' @@ -571,7 +572,7 @@ cl_git_pass(git_oid_fromstr(&old_id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); cl_git_pass(git_commit_lookup(&old_commit, g_repo, &old_id)); - cl_git_pass(git_reset(g_repo, (git_object *)old_commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(g_repo, (git_object *)old_commit, GIT_RESET_HARD, NULL)); cl_git_pass(p_unlink("testrepo/branch_file.txt")); cl_git_pass(git_index_remove_bypath(index ,"branch_file.txt")); @@ -645,7 +646,14 @@ cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), -5555); cl_assert(!git_path_exists("testrepo/new.txt")); - cl_assert_equal_i(4, ca.count); + + /* on case-insensitive FS = a/b.txt, branch_file.txt, new.txt */ + /* on case-sensitive FS = README, then above */ + + if (git_path_exists("testrepo/.git/CoNfIg")) /* case insensitive */ + cl_assert_equal_i(3, ca.count); + else + cl_assert_equal_i(4, ca.count); /* and again with a different stopping point and return code */ ca.filename = "README"; @@ -655,7 +663,11 @@ cl_git_fail_with(git_checkout_tree(g_repo, obj, &opts), 123); cl_assert(!git_path_exists("testrepo/new.txt")); - cl_assert_equal_i(1, ca.count); + + if (git_path_exists("testrepo/.git/CoNfIg")) /* case insensitive */ + cl_assert_equal_i(4, ca.count); + else + cl_assert_equal_i(1, ca.count); git_object_free(obj); } @@ -676,7 +688,7 @@ cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id)); cl_git_pass(git_checkout_tree(g_repo, (git_object *)commit, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master")); cl_git_pass(p_mkdir("./testrepo/this-is-dir", 0777)); cl_git_mkfile("./testrepo/this-is-dir/contained_file", "content\n"); @@ -824,7 +836,8 @@ g_repo = cl_git_sandbox_init("testrepo.git"); cl_assert(git_repository_is_bare(g_repo)); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE | + GIT_CHECKOUT_RECREATE_MISSING; opts.notify_flags = GIT_CHECKOUT_NOTIFY_ALL; opts.notify_cb = checkout_count_callback; @@ -880,16 +893,16 @@ memset(&entry, 0x0, sizeof(git_index_entry)); entry.mode = 0100644; - entry.flags = 1 << GIT_IDXENTRY_STAGESHIFT; + GIT_IDXENTRY_STAGE_SET(&entry, 1); git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46"); entry.path = path; cl_git_pass(git_index_add(index, &entry)); - entry.flags = 2 << GIT_IDXENTRY_STAGESHIFT; + GIT_IDXENTRY_STAGE_SET(&entry, 2); git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf"); cl_git_pass(git_index_add(index, &entry)); - entry.flags = 3 << GIT_IDXENTRY_STAGESHIFT; + GIT_IDXENTRY_STAGE_SET(&entry, 3); git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863"); cl_git_pass(git_index_add(index, &entry)); @@ -923,18 +936,43 @@ git_index *index; const git_index_entry *entry; + opts.checkout_strategy = GIT_CHECKOUT_FORCE; + cl_git_pass(git_repository_index(&index, g_repo)); + /* test a freshly added executable */ cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6")); cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); - opts.checkout_strategy = GIT_CHECKOUT_FORCE; - cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); cl_assert(entry = git_index_get_bypath(index, "executable.txt", 0)); cl_assert_equal_i(0100755, entry->mode); git_commit_free(commit); + + + /* Now start with a commit which has a text file */ + cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9")); + cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); + + cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); + cl_assert(entry = git_index_get_bypath(index, "a/b.txt", 0)); + cl_assert_equal_i(0100644, entry->mode); + + git_commit_free(commit); + + + /* And then check out to a commit which converts the text file to an executable */ + cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e")); + cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid)); + + cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts)); + cl_assert(entry = git_index_get_bypath(index, "a/b.txt", 0)); + cl_assert_equal_i(0100755, entry->mode); + + git_commit_free(commit); + + git_index_free(index); } @@ -1047,7 +1085,7 @@ cl_git_pass(git_commit_lookup(&dir_commit, g_repo, &dir_commit_id)); cl_git_pass(git_checkout_tree(g_repo, (git_object *)dir_commit, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir")); cl_assert(git_path_isfile("testrepo/README")); case_sensitive = !git_path_isfile("testrepo/readme"); @@ -1084,7 +1122,7 @@ cl_git_pass(git_commit_lookup(&master_commit, g_repo, &master_id)); cl_git_pass(git_checkout_tree(g_repo, (git_object *)master_commit, &opts)); - cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master")); assert_on_branch(g_repo, "master"); @@ -1102,3 +1140,201 @@ git_commit_free(master_commit); } +void perfdata_cb(const git_checkout_perfdata *in, void *payload) +{ + memcpy(payload, in, sizeof(git_checkout_perfdata)); +} + +void test_checkout_tree__can_collect_perfdata(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_oid oid; + git_object *obj = NULL; + git_checkout_perfdata perfdata = {0}; + + opts.perfdata_cb = perfdata_cb; + opts.perfdata_payload = &perfdata; + + assert_on_branch(g_repo, "master"); + opts.checkout_strategy = GIT_CHECKOUT_FORCE; + + cl_git_pass(git_reference_name_to_id(&oid, g_repo, "refs/heads/dir")); + cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); + + cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); + + cl_assert(perfdata.mkdir_calls > 0); + cl_assert(perfdata.stat_calls > 0); + + git_object_free(obj); +} + +void update_attr_callback( + const char *path, + size_t completed_steps, + size_t total_steps, + void *payload) +{ + GIT_UNUSED(completed_steps); + GIT_UNUSED(total_steps); + GIT_UNUSED(payload); + + if (path && strcmp(path, "ident1.txt") == 0) + cl_git_write2file("testrepo/.gitattributes", + "*.txt ident\n", 12, O_RDWR|O_CREAT, 0666); +} + +void test_checkout_tree__caches_attributes_during_checkout(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_oid oid; + git_object *obj = NULL; + git_buf ident1 = GIT_BUF_INIT, ident2 = GIT_BUF_INIT; + char *ident_paths[] = { "ident1.txt", "ident2.txt" }; + + opts.progress_cb = update_attr_callback; + + assert_on_branch(g_repo, "master"); + opts.checkout_strategy = GIT_CHECKOUT_FORCE; + opts.paths.strings = ident_paths; + opts.paths.count = 2; + + cl_git_pass(git_reference_name_to_id(&oid, g_repo, "refs/heads/ident")); + cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); + + cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); + + cl_git_pass(git_futils_readbuffer(&ident1, "testrepo/ident1.txt")); + cl_git_pass(git_futils_readbuffer(&ident2, "testrepo/ident2.txt")); + + cl_assert_equal_strn(ident1.ptr, "# $Id$", 6); + cl_assert_equal_strn(ident2.ptr, "# $Id$", 6); + + cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); + + cl_git_pass(git_futils_readbuffer(&ident1, "testrepo/ident1.txt")); + cl_git_pass(git_futils_readbuffer(&ident2, "testrepo/ident2.txt")); + + cl_assert_equal_strn(ident1.ptr, "# $Id: ", 7); + cl_assert_equal_strn(ident2.ptr, "# $Id: ", 7); + + git_buf_free(&ident1); + git_buf_free(&ident2); + git_object_free(obj); +} + +void test_checkout_tree__can_not_update_index(void) +{ + git_oid oid; + git_object *head; + unsigned int status; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_index *index; + + opts.checkout_strategy |= + GIT_CHECKOUT_FORCE | GIT_CHECKOUT_DONT_UPDATE_INDEX; + + cl_git_pass(git_reference_name_to_id(&oid, g_repo, "HEAD")); + cl_git_pass(git_object_lookup(&head, g_repo, &oid, GIT_OBJ_ANY)); + + cl_git_pass(git_reset(g_repo, head, GIT_RESET_HARD, &g_opts)); + + cl_assert_equal_i(false, git_path_isdir("./testrepo/ab/")); + + cl_git_pass(git_revparse_single(&g_object, g_repo, "subtrees")); + + cl_git_pass(git_checkout_tree(g_repo, g_object, &opts)); + + cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt")); + cl_git_pass(git_status_file(&status, g_repo, "ab/de/2.txt")); + cl_assert_equal_i(GIT_STATUS_WT_NEW, status); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_write(index)); + + cl_git_pass(git_status_file(&status, g_repo, "ab/de/2.txt")); + cl_assert_equal_i(GIT_STATUS_WT_NEW, status); + + git_object_free(head); + git_index_free(index); +} + +void test_checkout_tree__can_update_but_not_write_index(void) +{ + git_oid oid; + git_object *head; + unsigned int status; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_index *index; + git_repository *other; + + opts.checkout_strategy |= + GIT_CHECKOUT_FORCE | GIT_CHECKOUT_DONT_WRITE_INDEX; + + cl_git_pass(git_reference_name_to_id(&oid, g_repo, "HEAD")); + cl_git_pass(git_object_lookup(&head, g_repo, &oid, GIT_OBJ_ANY)); + + cl_git_pass(git_reset(g_repo, head, GIT_RESET_HARD, &g_opts)); + + cl_assert_equal_i(false, git_path_isdir("./testrepo/ab/")); + + cl_git_pass(git_revparse_single(&g_object, g_repo, "subtrees")); + + cl_git_pass(git_checkout_tree(g_repo, g_object, &opts)); + + cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt")); + cl_git_pass(git_status_file(&status, g_repo, "ab/de/2.txt")); + cl_assert_equal_i(GIT_STATUS_INDEX_NEW, status); + + cl_git_pass(git_repository_open(&other, "testrepo")); + cl_git_pass(git_status_file(&status, other, "ab/de/2.txt")); + cl_assert_equal_i(GIT_STATUS_WT_NEW, status); + git_repository_free(other); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_write(index)); + + cl_git_pass(git_repository_open(&other, "testrepo")); + cl_git_pass(git_status_file(&status, other, "ab/de/2.txt")); + cl_assert_equal_i(GIT_STATUS_INDEX_NEW, status); + git_repository_free(other); + + git_object_free(head); + git_index_free(index); +} + +/* Emulate checking out in a repo created by clone --no-checkout, + * which would not have written an index. */ +void test_checkout_tree__safe_proceeds_if_no_index(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_oid oid; + git_object *obj = NULL; + + assert_on_branch(g_repo, "master"); + cl_must_pass(p_unlink("testrepo/.git/index")); + + /* do second checkout safe because we should be clean after first */ + opts.checkout_strategy = GIT_CHECKOUT_SAFE; + + cl_git_pass(git_reference_name_to_id(&oid, g_repo, "refs/heads/subtrees")); + cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY)); + + cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); + cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees")); + + cl_assert(git_path_isfile("testrepo/README")); + cl_assert(git_path_isfile("testrepo/branch_file.txt")); + cl_assert(git_path_isfile("testrepo/new.txt")); + cl_assert(git_path_isfile("testrepo/ab/4.txt")); + cl_assert(git_path_isfile("testrepo/ab/c/3.txt")); + cl_assert(git_path_isfile("testrepo/ab/de/2.txt")); + cl_assert(git_path_isfile("testrepo/ab/de/fgh/1.txt")); + + cl_assert(!git_path_isdir("testrepo/a")); + + assert_on_branch(g_repo, "subtrees"); + + git_object_free(obj); +} + diff -Nru libgit2-0.22.2/tests/checkout/typechange.c libgit2-0.23.1/tests/checkout/typechange.c --- libgit2-0.22.2/tests/checkout/typechange.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/checkout/typechange.c 2015-08-03 18:07:35.000000000 +0000 @@ -122,7 +122,7 @@ cl_git_pass(git_checkout_tree(g_repo, obj, &opts)); cl_git_pass( - git_repository_set_head_detached(g_repo, git_object_id(obj), NULL, NULL)); + git_repository_set_head_detached(g_repo, git_object_id(obj))); assert_workdir_matches_tree(g_repo, git_object_id(obj), NULL, true); @@ -212,7 +212,7 @@ p_mkdir("typechanges/d", 0777); /* intentionally empty dir */ force_create_file("typechanges/untracked"); - opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + opts.checkout_strategy = GIT_CHECKOUT_SAFE; memset(&cts, 0, sizeof(cts)); cl_git_fail(git_checkout_tree(g_repo, obj, &opts)); @@ -231,7 +231,7 @@ cl_assert(!git_path_exists("typechanges/untracked")); cl_git_pass( - git_repository_set_head_detached(g_repo, git_object_id(obj), NULL, NULL)); + git_repository_set_head_detached(g_repo, git_object_id(obj))); assert_workdir_matches_tree(g_repo, git_object_id(obj), NULL, true); diff -Nru libgit2-0.22.2/tests/cherrypick/workdir.c libgit2-0.23.1/tests/cherrypick/workdir.c --- libgit2-0.22.2/tests/cherrypick/workdir.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/cherrypick/workdir.c 2015-08-03 18:07:35.000000000 +0000 @@ -66,7 +66,7 @@ git_tree *cherrypicked_tree = NULL; cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, cherrypick_oids[i]); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -118,7 +118,7 @@ cl_assert(git_path_exists(TEST_REPO_PATH "/file4.txt")); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, cherrypick_oid); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -155,7 +155,7 @@ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -263,7 +263,7 @@ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -275,7 +275,7 @@ /* resolve conflicts in the index by taking "ours" */ opts.merge_opts.file_favor = GIT_MERGE_FILE_FAVOR_OURS; - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); cl_git_pass(git_cherrypick(repo, commit, &opts)); cl_assert(merge_test_index(repo_index, merge_filesystem_entries, 3)); @@ -300,12 +300,12 @@ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 0, "file3.txt.renamed" }, }; - opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -335,12 +335,12 @@ { 0100644, "28d9eb4208074ad1cc84e71ccc908b34573f05d2", 2, "file3.txt.renamed_on_branch" }, }; - opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -391,7 +391,7 @@ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -423,7 +423,7 @@ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); @@ -455,7 +455,7 @@ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff"); cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid)); diff -Nru libgit2-0.22.2/tests/clar/fixtures.h libgit2-0.23.1/tests/clar/fixtures.h --- libgit2-0.22.2/tests/clar/fixtures.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clar/fixtures.h 2015-08-03 18:07:35.000000000 +0000 @@ -20,6 +20,19 @@ return _path; } +static const char * +fixture_basename(const char *fixture_name) +{ + const char *p; + + for (p = fixture_name; *p; p++) { + if (p[0] == '/' && p[1] && p[1] != '/') + fixture_name = p+1; + } + + return fixture_name; +} + #ifdef CLAR_FIXTURE_PATH const char *cl_fixture(const char *fixture_name) { @@ -33,6 +46,6 @@ void cl_fixture_cleanup(const char *fixture_name) { - fs_rm(fixture_path(_clar_path, fixture_name)); + fs_rm(fixture_path(_clar_path, fixture_basename(fixture_name))); } #endif diff -Nru libgit2-0.22.2/tests/clar/sandbox.h libgit2-0.23.1/tests/clar/sandbox.h --- libgit2-0.22.2/tests/clar/sandbox.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clar/sandbox.h 2015-08-03 18:07:35.000000000 +0000 @@ -65,7 +65,7 @@ if (_clar_path[0] == '\0') return; - chdir(".."); + cl_must_pass(chdir("..")); fs_rm(_clar_path); } diff -Nru libgit2-0.22.2/tests/clar.c libgit2-0.23.1/tests/clar.c --- libgit2-0.22.2/tests/clar.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clar.c 2015-08-03 18:07:35.000000000 +0000 @@ -132,6 +132,10 @@ jmp_buf trampoline; int trampoline_enabled; + + cl_trace_cb *pfn_trace_cb; + void *trace_payload; + } _clar; struct clar_func { @@ -163,6 +167,23 @@ /* Load the declarations for the test suite */ #include "clar.suite" + +#define CL_TRACE(ev) \ + do { \ + if (_clar.pfn_trace_cb) \ + _clar.pfn_trace_cb(ev, \ + _clar.active_suite, \ + _clar.active_test, \ + _clar.trace_payload); \ + } while (0) + +void cl_trace_register(cl_trace_cb *cb, void *payload) +{ + _clar.pfn_trace_cb = cb; + _clar.trace_payload = payload; +} + + /* Core test functions */ static void clar_report_errors(void) @@ -191,11 +212,15 @@ _clar.test_status = CL_TEST_OK; _clar.trampoline_enabled = 1; + CL_TRACE(CL_TRACE__TEST__BEGIN); + if (setjmp(_clar.trampoline) == 0) { if (initialize->ptr != NULL) initialize->ptr(); + CL_TRACE(CL_TRACE__TEST__RUN_BEGIN); test->ptr(); + CL_TRACE(CL_TRACE__TEST__RUN_END); } _clar.trampoline_enabled = 0; @@ -206,6 +231,8 @@ if (cleanup->ptr != NULL) cleanup->ptr(); + CL_TRACE(CL_TRACE__TEST__END); + _clar.tests_ran++; /* remove any local-set cleanup methods */ @@ -235,6 +262,8 @@ clar_print_onsuite(suite->name, ++_clar.suites_ran); _clar.active_suite = suite->name; + _clar.active_test = NULL; + CL_TRACE(CL_TRACE__SUITE_BEGIN); if (filter) { size_t suitelen = strlen(suite->name); @@ -259,6 +288,9 @@ if (_clar.exit_on_error && _clar.total_errors) return; } + + _clar.active_test = NULL; + CL_TRACE(CL_TRACE__SUITE_END); } static void @@ -269,6 +301,7 @@ printf(" -sname\tRun only the suite with `name` (can go to individual test name)\n"); printf(" -iname\tInclude the suite with `name`\n"); printf(" -xname\tExclude the suite with `name`\n"); + printf(" -v \tIncrease verbosity (show suite names)\n"); printf(" -q \tOnly report tests that had an error\n"); printf(" -Q \tQuit as soon as a test fails\n"); printf(" -l \tPrint suite names\n"); @@ -313,7 +346,7 @@ _clar.report_suite_names = 1; switch (action) { - case 's': clar_run_suite(&_clar_suites[j], argument); break; + case 's': _clar_suites[j].enabled = 1; clar_run_suite(&_clar_suites[j], argument); break; case 'i': _clar_suites[j].enabled = 1; break; case 'x': _clar_suites[j].enabled = 0; break; } @@ -347,6 +380,10 @@ exit(0); } + case 'v': + _clar.report_suite_names = 1; + break; + default: clar_usage(argv[0]); } @@ -419,6 +456,7 @@ exit(-1); } + CL_TRACE(CL_TRACE__TEST__LONGJMP); longjmp(_clar.trampoline, -1); } diff -Nru libgit2-0.22.2/tests/clar.h libgit2-0.23.1/tests/clar.h --- libgit2-0.22.2/tests/clar.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clar.h 2015-08-03 18:07:35.000000000 +0000 @@ -26,6 +26,48 @@ void cl_set_cleanup(void (*cleanup)(void *), void *opaque); void cl_fs_cleanup(void); +/** + * cl_trace_* is a hook to provide a simple global tracing + * mechanism. + * + * The goal here is to let main() provide clar-proper + * with a callback to optionally write log info for + * test operations into the same stream used by their + * actual tests. This would let them print test names + * and maybe performance data as they choose. + * + * The goal is NOT to alter the flow of control or to + * override test selection/skipping. (So the callback + * does not return a value.) + * + * The goal is NOT to duplicate the existing + * pass/fail/skip reporting. (So the callback + * does not accept a status/errorcode argument.) + * + */ +typedef enum cl_trace_event { + CL_TRACE__SUITE_BEGIN, + CL_TRACE__SUITE_END, + CL_TRACE__TEST__BEGIN, + CL_TRACE__TEST__END, + CL_TRACE__TEST__RUN_BEGIN, + CL_TRACE__TEST__RUN_END, + CL_TRACE__TEST__LONGJMP, +} cl_trace_event; + +typedef void (cl_trace_cb)( + cl_trace_event ev, + const char *suite_name, + const char *test_name, + void *payload); + +/** + * Register a callback into CLAR to send global trace events. + * Pass NULL to disable. + */ +void cl_trace_register(cl_trace_cb *cb, void *payload); + + #ifdef CLAR_FIXTURE_PATH const char *cl_fixture(const char *fixture_name); void cl_fixture_sandbox(const char *fixture_name); diff -Nru libgit2-0.22.2/tests/clar_libgit2.c libgit2-0.23.1/tests/clar_libgit2.c --- libgit2-0.22.2/tests/clar_libgit2.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clar_libgit2.c 2015-08-03 18:07:35.000000000 +0000 @@ -53,6 +53,11 @@ cl_git_write2file(path, content, 0, O_WRONLY | O_CREAT | O_TRUNC, 0644); } +void cl_git_rmfile(const char *filename) +{ + cl_must_pass(p_unlink(filename)); +} + #ifdef GIT_WIN32 #include "win32/utf-conv.h" @@ -192,6 +197,14 @@ return _cl_repo; } +git_repository *cl_git_sandbox_init_new(const char *sandbox) +{ + cl_git_pass(git_repository_init(&_cl_repo, sandbox, false)); + _cl_sandbox = sandbox; + + return _cl_repo; +} + git_repository *cl_git_sandbox_reopen(void) { if (_cl_repo) { @@ -470,8 +483,8 @@ for (pos = 0; pos < bytes && expected_data[pos] == buf[pos]; ++pos) /* find differing byte offset */; p_snprintf( - buf, sizeof(buf), "file content mismatch at byte %d", - (int)(total_bytes + pos)); + buf, sizeof(buf), "file content mismatch at byte %"PRIdZ, + (ssize_t)(total_bytes + pos)); p_close(fd); clar__fail(file, line, path, buf, 1); } diff -Nru libgit2-0.22.2/tests/clar_libgit2.h libgit2-0.23.1/tests/clar_libgit2.h --- libgit2-0.22.2/tests/clar_libgit2.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clar_libgit2.h 2015-08-03 18:07:35.000000000 +0000 @@ -112,6 +112,7 @@ void cl_git_rewritefile(const char *filename, const char *new_content); void cl_git_write2file(const char *path, const char *data, size_t datalen, int flags, unsigned int mode); +void cl_git_rmfile(const char *filename); bool cl_toggle_filemode(const char *filename); bool cl_is_chmod_supported(void); @@ -126,6 +127,7 @@ /* Git sandbox setup helpers */ git_repository *cl_git_sandbox_init(const char *sandbox); +git_repository *cl_git_sandbox_init_new(const char *name); void cl_git_sandbox_cleanup(void); git_repository *cl_git_sandbox_reopen(void); diff -Nru libgit2-0.22.2/tests/clar_libgit2_timer.c libgit2-0.23.1/tests/clar_libgit2_timer.c --- libgit2-0.22.2/tests/clar_libgit2_timer.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/clar_libgit2_timer.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,31 @@ +#include "clar_libgit2.h" +#include "clar_libgit2_timer.h" +#include "buffer.h" + +void cl_perf_timer__init(cl_perf_timer *t) +{ + memset(t, 0, sizeof(cl_perf_timer)); +} + +void cl_perf_timer__start(cl_perf_timer *t) +{ + t->time_started = git__timer(); +} + +void cl_perf_timer__stop(cl_perf_timer *t) +{ + double time_now = git__timer(); + + t->last = time_now - t->time_started; + t->sum += t->last; +} + +double cl_perf_timer__last(const cl_perf_timer *t) +{ + return t->last; +} + +double cl_perf_timer__sum(const cl_perf_timer *t) +{ + return t->sum; +} diff -Nru libgit2-0.22.2/tests/clar_libgit2_timer.h libgit2-0.23.1/tests/clar_libgit2_timer.h --- libgit2-0.22.2/tests/clar_libgit2_timer.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/clar_libgit2_timer.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,35 @@ +#ifndef __CLAR_LIBGIT2_TIMER__ +#define __CLAR_LIBGIT2_TIMER__ + +struct cl_perf_timer +{ + /* cummulative running time across all start..stop intervals */ + double sum; + + /* value of last start..stop interval */ + double last; + + /* clock value at start */ + double time_started; +}; + +#define CL_PERF_TIMER_INIT {0} + +typedef struct cl_perf_timer cl_perf_timer; + +void cl_perf_timer__init(cl_perf_timer *t); +void cl_perf_timer__start(cl_perf_timer *t); +void cl_perf_timer__stop(cl_perf_timer *t); + +/** + * return value of last start..stop interval in seconds. + */ +double cl_perf_timer__last(const cl_perf_timer *t); + +/** + * return cummulative running time across all start..stop + * intervals in seconds. + */ +double cl_perf_timer__sum(const cl_perf_timer *t); + +#endif /* __CLAR_LIBGIT2_TIMER__ */ diff -Nru libgit2-0.22.2/tests/clar_libgit2_trace.c libgit2-0.23.1/tests/clar_libgit2_trace.c --- libgit2-0.22.2/tests/clar_libgit2_trace.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/clar_libgit2_trace.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,229 @@ +#include "clar_libgit2.h" +#include "clar_libgit2_trace.h" +#include "clar_libgit2_timer.h" +#include "trace.h" + + +struct method { + const char *name; + void (*git_trace_cb)(git_trace_level_t level, const char *msg); + void (*close)(void); +}; + + +#if defined(GIT_TRACE) +static void _git_trace_cb__printf(git_trace_level_t level, const char *msg) +{ + /* TODO Use level to print a per-message prefix. */ + GIT_UNUSED(level); + + printf("%s\n", msg); +} + +#if defined(GIT_WIN32) +static void _git_trace_cb__debug(git_trace_level_t level, const char *msg) +{ + /* TODO Use level to print a per-message prefix. */ + GIT_UNUSED(level); + + OutputDebugString(msg); + OutputDebugString("\n"); + + printf("%s\n", msg); +} +#else +#define _git_trace_cb__debug _git_trace_cb__printf +#endif + + +static void _trace_printf_close(void) +{ + fflush(stdout); +} + +#define _trace_debug_close _trace_printf_close + + +static struct method s_methods[] = { + { "printf", _git_trace_cb__printf, _trace_printf_close }, + { "debug", _git_trace_cb__debug, _trace_debug_close }, + /* TODO add file method */ + {0}, +}; + + +static int s_trace_loaded = 0; +static int s_trace_level = GIT_TRACE_NONE; +static struct method *s_trace_method = NULL; + + +static int set_method(const char *name) +{ + int k; + + if (!name || !*name) + name = "printf"; + + for (k=0; (s_methods[k].name); k++) { + if (strcmp(name, s_methods[k].name) == 0) { + s_trace_method = &s_methods[k]; + return 0; + } + } + fprintf(stderr, "Unknown CLAR_TRACE_METHOD: '%s'\n", name); + return -1; +} + + +/** + * Lookup CLAR_TRACE_LEVEL and CLAR_TRACE_METHOD from + * the environment and set the above s_trace_* fields. + * + * If CLAR_TRACE_LEVEL is not set, we disable tracing. + * + * TODO If set, we assume GIT_TRACE_TRACE level, which + * logs everything. Later, we may want to parse the + * value of the environment variable and set a specific + * level. + * + * We assume the "printf" method. This can be changed + * with the CLAR_TRACE_METHOD environment variable. + * Currently, this is only needed on Windows for a "debug" + * version which also writes to the debug output window + * in Visual Studio. + * + * TODO add a "file" method that would open and write + * to a well-known file. This would help keep trace + * output and clar output separate. + * + */ +static void _load_trace_params(void) +{ + char *sz_level; + char *sz_method; + + s_trace_loaded = 1; + + sz_level = cl_getenv("CLAR_TRACE_LEVEL"); + if (!sz_level || !*sz_level) { + s_trace_level = GIT_TRACE_NONE; + s_trace_method = NULL; + return; + } + + /* TODO Parse sz_level and set s_trace_level. */ + s_trace_level = GIT_TRACE_TRACE; + + sz_method = cl_getenv("CLAR_TRACE_METHOD"); + if (set_method(sz_method) < 0) + set_method(NULL); +} + +#define HR "================================================================" + +/** + * Timer to report the take spend in a test's run() method. + */ +static cl_perf_timer s_timer_run = CL_PERF_TIMER_INIT; + +/** + * Timer to report total time in a test (init, run, cleanup). + */ +static cl_perf_timer s_timer_test = CL_PERF_TIMER_INIT; + +void _cl_trace_cb__event_handler( + cl_trace_event ev, + const char *suite_name, + const char *test_name, + void *payload) +{ + GIT_UNUSED(payload); + + switch (ev) { + case CL_TRACE__SUITE_BEGIN: + git_trace(GIT_TRACE_TRACE, "\n\n%s\n%s: Begin Suite", HR, suite_name); + break; + + case CL_TRACE__SUITE_END: + git_trace(GIT_TRACE_TRACE, "\n\n%s: End Suite\n%s", suite_name, HR); + break; + + case CL_TRACE__TEST__BEGIN: + git_trace(GIT_TRACE_TRACE, "\n%s::%s: Begin Test", suite_name, test_name); + cl_perf_timer__init(&s_timer_test); + cl_perf_timer__start(&s_timer_test); + break; + + case CL_TRACE__TEST__END: + cl_perf_timer__stop(&s_timer_test); + git_trace(GIT_TRACE_TRACE, "%s::%s: End Test (%.3f %.3f)", suite_name, test_name, + cl_perf_timer__last(&s_timer_run), + cl_perf_timer__last(&s_timer_test)); + break; + + case CL_TRACE__TEST__RUN_BEGIN: + git_trace(GIT_TRACE_TRACE, "%s::%s: Begin Run", suite_name, test_name); + cl_perf_timer__init(&s_timer_run); + cl_perf_timer__start(&s_timer_run); + break; + + case CL_TRACE__TEST__RUN_END: + cl_perf_timer__stop(&s_timer_run); + git_trace(GIT_TRACE_TRACE, "%s::%s: End Run", suite_name, test_name); + break; + + case CL_TRACE__TEST__LONGJMP: + cl_perf_timer__stop(&s_timer_run); + git_trace(GIT_TRACE_TRACE, "%s::%s: Aborted", suite_name, test_name); + break; + + default: + break; + } +} + +#endif /*GIT_TRACE*/ + +/** + * Setup/Enable git_trace() based upon settings user's environment. + * + */ +void cl_global_trace_register(void) +{ +#if defined(GIT_TRACE) + if (!s_trace_loaded) + _load_trace_params(); + + if (s_trace_level == GIT_TRACE_NONE) + return; + if (s_trace_method == NULL) + return; + if (s_trace_method->git_trace_cb == NULL) + return; + + git_trace_set(s_trace_level, s_trace_method->git_trace_cb); + cl_trace_register(_cl_trace_cb__event_handler, NULL); +#endif +} + +/** + * If we turned on git_trace() earlier, turn it off. + * + * This is intended to let us close/flush any buffered + * IO if necessary. + * + */ +void cl_global_trace_disable(void) +{ +#if defined(GIT_TRACE) + cl_trace_register(NULL, NULL); + git_trace_set(GIT_TRACE_NONE, NULL); + if (s_trace_method && s_trace_method->close) + s_trace_method->close(); + + /* Leave s_trace_ vars set so they can restart tracing + * since we only want to hit the environment variables + * once. + */ +#endif +} diff -Nru libgit2-0.22.2/tests/clar_libgit2_trace.h libgit2-0.23.1/tests/clar_libgit2_trace.h --- libgit2-0.22.2/tests/clar_libgit2_trace.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/clar_libgit2_trace.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,7 @@ +#ifndef __CLAR_LIBGIT2_TRACE__ +#define __CLAR_LIBGIT2_TRACE__ + +void cl_global_trace_register(void); +void cl_global_trace_disable(void); + +#endif diff -Nru libgit2-0.22.2/tests/clone/empty.c libgit2-0.23.1/tests/clone/empty.c --- libgit2-0.22.2/tests/clone/empty.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clone/empty.c 2015-08-03 18:07:35.000000000 +0000 @@ -10,14 +10,14 @@ void test_clone_empty__initialize(void) { git_repository *sandbox = cl_git_sandbox_init("empty_bare.git"); - git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options dummy_options = GIT_FETCH_OPTIONS_INIT; cl_git_remove_placeholders(git_repository_path(sandbox), "dummy-marker.txt"); g_repo = NULL; memset(&g_options, 0, sizeof(git_clone_options)); g_options.version = GIT_CLONE_OPTIONS_VERSION; - g_options.remote_callbacks = dummy_callbacks; + g_options.fetch_opts = dummy_options; } void test_clone_empty__cleanup(void) diff -Nru libgit2-0.22.2/tests/clone/nonetwork.c libgit2-0.23.1/tests/clone/nonetwork.c --- libgit2-0.22.2/tests/clone/nonetwork.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clone/nonetwork.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,6 +1,8 @@ #include "clar_libgit2.h" #include "git2/clone.h" +#include "git2/sys/commit.h" +#include "../submodule/submodule_helpers.h" #include "remote.h" #include "fileops.h" #include "repository.h" @@ -15,16 +17,15 @@ void test_clone_nonetwork__initialize(void) { git_checkout_options dummy_opts = GIT_CHECKOUT_OPTIONS_INIT; - git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options dummy_fetch = GIT_FETCH_OPTIONS_INIT; g_repo = NULL; memset(&g_options, 0, sizeof(git_clone_options)); g_options.version = GIT_CLONE_OPTIONS_VERSION; g_options.checkout_opts = dummy_opts; - g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; - g_options.remote_callbacks = dummy_callbacks; - cl_git_pass(git_signature_now(&g_options.signature, "Me", "foo@example.com")); + g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; + g_options.fetch_opts = dummy_fetch; } void test_clone_nonetwork__cleanup(void) @@ -44,7 +45,6 @@ g_remote = NULL; } - git_signature_free(g_options.signature); cl_fixture_cleanup("./foo"); } @@ -181,7 +181,7 @@ { g_options.checkout_branch = "test"; - g_options.remote_callbacks.transfer_progress = + g_options.fetch_opts.callbacks.transfer_progress = clone_cancel_fetch_transfer_progress_cb; cl_git_fail_with(git_clone( @@ -228,13 +228,11 @@ git_object *obj; git_repository *cloned; git_reference *cloned_head; - git_reflog *log; - const git_reflog_entry *entry; cl_git_pass(git_clone(&g_repo, cl_git_fixture_url("testrepo.git"), "./foo", &g_options)); cl_git_pass(git_revparse_single(&obj, g_repo, "master~1")); - cl_git_pass(git_repository_set_head_detached(g_repo, git_object_id(obj), NULL, NULL)); + cl_git_pass(git_repository_set_head_detached(g_repo, git_object_id(obj))); cl_git_pass(git_clone(&cloned, "./foo", "./foo1", &g_options)); @@ -243,18 +241,58 @@ cl_git_pass(git_repository_head(&cloned_head, cloned)); cl_assert_equal_oid(git_object_id(obj), git_reference_target(cloned_head)); - cl_git_pass(git_reflog_read(&log, cloned, "HEAD")); - entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); - git_object_free(obj); git_reference_free(cloned_head); - git_reflog_free(log); git_repository_free(cloned); cl_fixture_cleanup("./foo1"); } +void test_clone_nonetwork__clone_tag_to_tree(void) +{ + git_repository *stage; + git_index_entry entry; + git_index *index; + git_odb *odb; + git_oid tree_id; + git_tree *tree; + git_reference *tag; + git_tree_entry *tentry; + const char *file_path = "some/deep/path.txt"; + const char *file_content = "some content\n"; + const char *tag_name = "refs/tags/tree-tag"; + + stage = cl_git_sandbox_init("testrepo.git"); + cl_git_pass(git_repository_odb(&odb, stage)); + cl_git_pass(git_index_new(&index)); + + memset(&entry, 0, sizeof(git_index_entry)); + entry.path = file_path; + entry.mode = GIT_FILEMODE_BLOB; + cl_git_pass(git_odb_write(&entry.id, odb, file_content, strlen(file_content), GIT_OBJ_BLOB)); + + cl_git_pass(git_index_add(index, &entry)); + cl_git_pass(git_index_write_tree_to(&tree_id, index, stage)); + cl_git_pass(git_reference_create(&tag, stage, tag_name, &tree_id, 0, NULL)); + git_reference_free(tag); + git_odb_free(odb); + git_index_free(index); + + g_options.local = GIT_CLONE_NO_LOCAL; + cl_git_pass(git_clone(&g_repo, cl_git_path_url(git_repository_path(stage)), "./foo", &g_options)); + git_repository_free(stage); + + cl_git_pass(git_reference_lookup(&tag, g_repo, tag_name)); + cl_git_pass(git_tree_lookup(&tree, g_repo, git_reference_target(tag))); + git_reference_free(tag); + + cl_git_pass(git_tree_entry_bypath(&tentry, tree, file_path)); + git_tree_entry_free(tentry); + git_tree_free(tree); + + cl_fixture_cleanup("testrepo.git"); +} + static void assert_correct_reflog(const char *name) { git_reflog *log; @@ -267,7 +305,6 @@ cl_assert_equal_i(1, git_reflog_entrycount(log)); entry = git_reflog_entry_byindex(log, 0); cl_assert_equal_s(expected_log_message, git_reflog_entry_message(entry)); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); git_reflog_free(log); } @@ -301,7 +338,7 @@ cl_set_cleanup(&cleanup_repository, "./repowithunborn"); cl_git_pass(git_clone(&repo, "./test1", "./repowithunborn", NULL)); - cl_git_pass(git_repository_config(&config, repo)); + cl_git_pass(git_repository_config_snapshot(&config, repo)); cl_git_pass(git_config_get_string(&str, config, "branch.master.remote")); cl_assert_equal_s("origin", str); @@ -312,3 +349,56 @@ git_repository_free(repo); cl_fixture_cleanup("./repowithunborn"); } + +static int just_return_origin(git_remote **out, git_repository *repo, const char *name, const char *url, void *payload) +{ + GIT_UNUSED(url); GIT_UNUSED(payload); + + return git_remote_lookup(out, repo, name); +} + +static int just_return_repo(git_repository **out, const char *path, int bare, void *payload) +{ + git_submodule *sm = payload; + + GIT_UNUSED(path); GIT_UNUSED(bare); + + return git_submodule_open(out, sm); +} + +void test_clone_nonetwork__clone_submodule(void) +{ + git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT; + git_index *index; + git_oid tree_id, commit_id; + git_submodule *sm; + git_signature *sig; + git_repository *sm_repo; + + cl_git_pass(git_repository_init(&g_repo, "willaddsubmodule", false)); + + + /* Create the submodule structure, clone into it and finalize */ + cl_git_pass(git_submodule_add_setup(&sm, g_repo, cl_fixture("testrepo.git"), "testrepo", true)); + + clone_opts.repository_cb = just_return_repo; + clone_opts.repository_cb_payload = sm; + clone_opts.remote_cb = just_return_origin; + clone_opts.remote_cb_payload = sm; + cl_git_pass(git_clone(&sm_repo, cl_fixture("testrepo.git"), "testrepo", &clone_opts)); + cl_git_pass(git_submodule_add_finalize(sm)); + git_repository_free(sm_repo); + git_submodule_free(sm); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_write_tree(&tree_id, index)); + git_index_free(index); + + cl_git_pass(git_signature_now(&sig, "Submoduler", "submoduler@local")); + cl_git_pass(git_commit_create_from_ids(&commit_id, g_repo, "HEAD", sig, sig, NULL, "A submodule\n", + &tree_id, 0, NULL)); + + git_signature_free(sig); + + assert_submodule_exists(g_repo, "testrepo"); +} diff -Nru libgit2-0.22.2/tests/clone/transport.c libgit2-0.23.1/tests/clone/transport.c --- libgit2-0.22.2/tests/clone/transport.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/clone/transport.c 2015-08-03 18:07:35.000000000 +0000 @@ -24,10 +24,9 @@ { int error; - if ((error = git_remote_create(out, repo, name, url)) < 0) - return error; + GIT_UNUSED(payload); - if ((error = git_remote_set_transport(*out, custom_transport, payload)) < 0) + if ((error = git_remote_create(out, repo, name, url)) < 0) return error; return 0; @@ -40,7 +39,8 @@ int custom_transport_used = 0; clone_opts.remote_cb = custom_transport_remote_create; - clone_opts.remote_cb_payload = &custom_transport_used; + clone_opts.fetch_opts.callbacks.transport = custom_transport; + clone_opts.fetch_opts.callbacks.payload = &custom_transport_used; cl_git_pass(git_clone(&repo, cl_fixture("testrepo.git"), "./custom_transport.git", &clone_opts)); git_repository_free(repo); diff -Nru libgit2-0.22.2/tests/commit/parse.c libgit2-0.23.1/tests/commit/parse.c --- libgit2-0.22.2/tests/commit/parse.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/commit/parse.c 2015-08-03 18:07:35.000000000 +0000 @@ -262,6 +262,13 @@ -----END PGP SIGNATURE-----\n\ \n\ a simple commit which works\n", +/* some tools create two author entries */ +"tree 1810dff58d8a660512d4832e740f692884338ccd\n\ +author Vicent Marti 1273848544 +0200\n\ +author Helpful Coworker 1273848544 +0200\n\ +committer Vicent Marti 1273848544 +0200\n\ +\n\ +a simple commit which works", }; static int parse_commit(git_commit **out, const char *buffer) @@ -411,3 +418,41 @@ cl_assert_equal_s(raw_message, git_commit_message_raw(commit)); git_commit__free(commit); } + +void test_commit_parse__arbitrary_field(void) +{ + git_commit *commit; + git_buf buf = GIT_BUF_INIT; + const char *gpgsig = "-----BEGIN PGP SIGNATURE-----\n\ +Version: GnuPG v1.4.12 (Darwin)\n\ +\n\ +iQIcBAABAgAGBQJQ+FMIAAoJEH+LfPdZDSs1e3EQAJMjhqjWF+WkGLHju7pTw2al\n\ +o6IoMAhv0Z/LHlWhzBd9e7JeCnanRt12bAU7yvYp9+Z+z+dbwqLwDoFp8LVuigl8\n\ +JGLcnwiUW3rSvhjdCp9irdb4+bhKUnKUzSdsR2CK4/hC0N2i/HOvMYX+BRsvqweq\n\ +AsAkA6dAWh+gAfedrBUkCTGhlNYoetjdakWqlGL1TiKAefEZrtA1TpPkGn92vbLq\n\ +SphFRUY9hVn1ZBWrT3hEpvAIcZag3rTOiRVT1X1flj8B2vGCEr3RrcwOIZikpdaW\n\ +who/X3xh/DGbI2RbuxmmJpxxP/8dsVchRJJzBwG+yhwU/iN3MlV2c5D69tls/Dok\n\ +6VbyU4lm/ae0y3yR83D9dUlkycOnmmlBAHKIZ9qUts9X7mWJf0+yy2QxJVpjaTGG\n\ +cmnQKKPeNIhGJk2ENnnnzjEve7L7YJQF6itbx5VCOcsGh3Ocb3YR7DMdWjt7f8pu\n\ +c6j+q1rP7EpE2afUN/geSlp5i3x8aXZPDj67jImbVCE/Q1X9voCtyzGJH7MXR0N9\n\ +ZpRF8yzveRfMH8bwAJjSOGAFF5XkcR/RNY95o+J+QcgBLdX48h+ZdNmUf6jqlu3J\n\ +7KmTXXQcOVpN6dD3CmRFsbjq+x6RHwa8u1iGn+oIkX908r97ckfB/kHKH7ZdXIJc\n\ +cpxtDQQMGYFpXK/71stq\n\ +=ozeK\n\ +-----END PGP SIGNATURE-----"; + + cl_git_pass(parse_commit(&commit, passing_commit_cases[4])); + + cl_git_pass(git_commit_header_field(&buf, commit, "parent")); + cl_assert_equal_s("34734e478d6cf50c27c9d69026d93974d052c454", buf.ptr); + git_buf_clear(&buf); + + cl_git_pass(git_commit_header_field(&buf, commit, "gpgsig")); + cl_assert_equal_s(gpgsig, buf.ptr); + + cl_git_fail_with(GIT_ENOTFOUND, git_commit_header_field(&buf, commit, "awesomeness")); + cl_git_fail_with(GIT_ENOTFOUND, git_commit_header_field(&buf, commit, "par")); + + git_buf_free(&buf); + git_commit__free(commit); +} diff -Nru libgit2-0.22.2/tests/commit/write.c libgit2-0.23.1/tests/commit/write.c --- libgit2-0.22.2/tests/commit/write.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/commit/write.c 2015-08-03 18:07:35.000000000 +0000 @@ -120,7 +120,7 @@ cl_assert(head_old != NULL); git_reference_free(head); - cl_git_pass(git_reference_symbolic_create(&head, g_repo, "HEAD", branch_name, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, g_repo, "HEAD", branch_name, 1, NULL)); cl_git_pass(git_commit_create_v( &commit_id, /* out id */ diff -Nru libgit2-0.22.2/tests/config/config_helpers.c libgit2-0.23.1/tests/config/config_helpers.c --- libgit2-0.22.2/tests/config/config_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/config_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,6 +1,7 @@ #include "clar_libgit2.h" #include "config_helpers.h" #include "repository.h" +#include "buffer.h" void assert_config_entry_existence( git_repository *repo, @@ -8,12 +9,13 @@ bool is_supposed_to_exist) { git_config *config; - const char *out; + git_config_entry *entry = NULL; int result; cl_git_pass(git_repository_config__weakptr(&config, repo)); - result = git_config_get_string(&out, config, name); + result = git_config_get_entry(&entry, config, name); + git_config_entry_free(entry); if (is_supposed_to_exist) cl_git_pass(result); @@ -27,13 +29,14 @@ const char *expected_value) { git_config *config; - const char *out; + git_buf buf = GIT_BUF_INIT; cl_git_pass(git_repository_config__weakptr(&config, repo)); - cl_git_pass(git_config_get_string(&out, config, name)); + cl_git_pass(git_config_get_string_buf(&buf, config, name)); - cl_assert_equal_s(expected_value, out); + cl_assert_equal_s(expected_value, git_buf_cstr(&buf)); + git_buf_free(&buf); } static int count_config_entries_cb( diff -Nru libgit2-0.22.2/tests/config/configlevel.c libgit2-0.23.1/tests/config/configlevel.c --- libgit2-0.22.2/tests/config/configlevel.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/configlevel.c 2015-08-03 18:07:35.000000000 +0000 @@ -22,7 +22,7 @@ void test_config_configlevel__can_replace_a_config_file_at_an_existing_level(void) { git_config *cfg; - const char *s; + git_buf buf = {0}; cl_git_pass(git_config_new(&cfg)); cl_git_pass(git_config_add_file_ondisk(cfg, cl_fixture("config/config18"), @@ -30,9 +30,10 @@ cl_git_pass(git_config_add_file_ondisk(cfg, cl_fixture("config/config19"), GIT_CONFIG_LEVEL_LOCAL, 1)); - cl_git_pass(git_config_get_string(&s, cfg, "core.stringglobal")); - cl_assert_equal_s("don't find me!", s); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.stringglobal")); + cl_assert_equal_s("don't find me!", buf.ptr); + git_buf_free(&buf); git_config_free(cfg); } @@ -40,7 +41,7 @@ { git_config *cfg; git_config *single_level_cfg; - const char *s; + git_buf buf = {0}; cl_git_pass(git_config_new(&cfg)); cl_git_pass(git_config_add_file_ondisk(cfg, cl_fixture("config/config18"), @@ -52,9 +53,10 @@ git_config_free(cfg); - cl_git_pass(git_config_get_string(&s, single_level_cfg, "core.stringglobal")); - cl_assert_equal_s("don't find me!", s); + cl_git_pass(git_config_get_string_buf(&buf, single_level_cfg, "core.stringglobal")); + cl_assert_equal_s("don't find me!", buf.ptr); + git_buf_free(&buf); git_config_free(single_level_cfg); } diff -Nru libgit2-0.22.2/tests/config/global.c libgit2-0.23.1/tests/config/global.c --- libgit2-0.22.2/tests/config/global.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/global.c 2015-08-03 18:07:35.000000000 +0000 @@ -46,8 +46,9 @@ void test_config_global__open_xdg(void) { git_config *cfg, *xdg, *selected; - const char *val, *str = "teststring"; + const char *str = "teststring"; const char *key = "this.variable"; + git_buf buf = {0}; cl_git_mkfile("xdg/git/config", "# XDG config\n[core]\n test = 1\n"); @@ -56,9 +57,10 @@ cl_git_pass(git_config_open_global(&selected, cfg)); cl_git_pass(git_config_set_string(xdg, key, str)); - cl_git_pass(git_config_get_string(&val, selected, key)); - cl_assert_equal_s(str, val); + cl_git_pass(git_config_get_string_buf(&buf, selected, key)); + cl_assert_equal_s(str, buf.ptr); + git_buf_free(&buf); git_config_free(selected); git_config_free(xdg); git_config_free(cfg); diff -Nru libgit2-0.22.2/tests/config/include.c libgit2-0.23.1/tests/config/include.c --- libgit2-0.22.2/tests/config/include.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/include.c 2015-08-03 18:07:35.000000000 +0000 @@ -5,20 +5,20 @@ void test_config_include__relative(void) { git_config *cfg; - const char *str; + git_buf buf = GIT_BUF_INIT; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config-include"))); - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.baz")); - cl_assert_equal_s(str, "huzzah"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar.baz")); + cl_assert_equal_s("huzzah", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); } void test_config_include__absolute(void) { git_config *cfg; - const char *str; git_buf buf = GIT_BUF_INIT; cl_git_pass(git_buf_printf(&buf, "[include]\npath = %s/config-included", cl_fixture("config"))); @@ -27,25 +27,27 @@ git_buf_free(&buf); cl_git_pass(git_config_open_ondisk(&cfg, "config-include-absolute")); - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.baz")); - cl_assert_equal_s(str, "huzzah"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar.baz")); + cl_assert_equal_s("huzzah", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); } void test_config_include__homedir(void) { git_config *cfg; - const char *str; + git_buf buf = GIT_BUF_INIT; cl_git_pass(git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, cl_fixture("config"))); cl_git_mkfile("config-include-homedir", "[include]\npath = ~/config-included"); cl_git_pass(git_config_open_ondisk(&cfg, "config-include-homedir")); - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.baz")); - cl_assert_equal_s(str, "huzzah"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar.baz")); + cl_assert_equal_s("huzzah", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); cl_sandbox_set_search_path_defaults(); @@ -55,7 +57,7 @@ void test_config_include__ordering(void) { git_config *cfg; - const char *str; + git_buf buf = GIT_BUF_INIT; cl_git_mkfile("included", "[foo \"bar\"]\nbaz = hurrah\nfrotz = hiya"); cl_git_mkfile("including", @@ -65,11 +67,13 @@ cl_git_pass(git_config_open_ondisk(&cfg, "including")); - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.frotz")); - cl_assert_equal_s(str, "hiya"); - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar.baz")); - cl_assert_equal_s(str, "huzzah"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar.frotz")); + cl_assert_equal_s("hiya", git_buf_cstr(&buf)); + git_buf_clear(&buf); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar.baz")); + cl_assert_equal_s("huzzah", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); } @@ -90,15 +94,40 @@ void test_config_include__missing(void) { git_config *cfg; - const char *str; + git_buf buf = GIT_BUF_INIT; cl_git_mkfile("including", "[include]\npath = nonexistentfile\n[foo]\nbar = baz"); giterr_clear(); cl_git_pass(git_config_open_ondisk(&cfg, "including")); cl_assert(giterr_last() == NULL); - cl_git_pass(git_config_get_string(&str, cfg, "foo.bar")); - cl_assert_equal_s(str, "baz"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar")); + cl_assert_equal_s("baz", git_buf_cstr(&buf)); + git_buf_free(&buf); + git_config_free(cfg); +} + +#define replicate10(s) s s s s s s s s s s +void test_config_include__depth2(void) +{ + git_config *cfg; + git_buf buf = GIT_BUF_INIT; + const char *content = "[include]\n" replicate10(replicate10("path=bottom\n")); + + cl_git_mkfile("top-level", "[include]\npath = middle\n[foo]\nbar = baz"); + cl_git_mkfile("middle", content); + cl_git_mkfile("bottom", "[foo]\nbar2 = baz2"); + + cl_git_pass(git_config_open_ondisk(&cfg, "top-level")); + + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar")); + cl_assert_equal_s("baz", git_buf_cstr(&buf)); + + git_buf_clear(&buf); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar2")); + cl_assert_equal_s("baz2", git_buf_cstr(&buf)); + + git_buf_free(&buf); git_config_free(cfg); } diff -Nru libgit2-0.22.2/tests/config/new.c libgit2-0.23.1/tests/config/new.c --- libgit2-0.22.2/tests/config/new.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/new.c 2015-08-03 18:07:35.000000000 +0000 @@ -8,8 +8,8 @@ void test_config_new__write_new_config(void) { - const char *out; git_config *config; + git_buf buf = GIT_BUF_INIT; cl_git_mkfile(TEST_CONFIG, ""); cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG)); @@ -21,11 +21,13 @@ cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG)); - cl_git_pass(git_config_get_string(&out, config, "color.ui")); - cl_assert_equal_s(out, "auto"); - cl_git_pass(git_config_get_string(&out, config, "core.editor")); - cl_assert_equal_s(out, "ed"); + cl_git_pass(git_config_get_string_buf(&buf, config, "color.ui")); + cl_assert_equal_s("auto", git_buf_cstr(&buf)); + git_buf_clear(&buf); + cl_git_pass(git_config_get_string_buf(&buf, config, "core.editor")); + cl_assert_equal_s("ed", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(config); p_unlink(TEST_CONFIG); diff -Nru libgit2-0.22.2/tests/config/read.c libgit2-0.23.1/tests/config/read.c --- libgit2-0.22.2/tests/config/read.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/read.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,4 +1,13 @@ #include "clar_libgit2.h" +#include "buffer.h" +#include "path.h" + +static git_buf buf = GIT_BUF_INIT; + +void test_config_read__cleanup(void) +{ + git_buf_free(&buf); +} void test_config_read__simple_read(void) { @@ -23,14 +32,15 @@ { git_config *cfg; int i; - const char *str; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config1"))); - cl_git_pass(git_config_get_string(&str, cfg, "this.that.other")); - cl_assert_equal_s(str, "true"); - cl_git_pass(git_config_get_string(&str, cfg, "this.That.other")); - cl_assert_equal_s(str, "yes"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "this.that.other")); + cl_assert_equal_s("true", git_buf_cstr(&buf)); + git_buf_clear(&buf); + + cl_git_pass(git_config_get_string_buf(&buf, cfg, "this.That.other")); + cl_assert_equal_s("yes", git_buf_cstr(&buf)); cl_git_pass(git_config_get_bool(&i, cfg, "this.that.other")); cl_assert(i == 1); @@ -50,12 +60,45 @@ void test_config_read__multiline_value(void) { git_config *cfg; - const char *str; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config2"))); - cl_git_pass(git_config_get_string(&str, cfg, "this.That.and")); - cl_assert_equal_s(str, "one one one two two three three"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "this.That.and")); + cl_assert_equal_s("one one one two two three three", git_buf_cstr(&buf)); + + git_config_free(cfg); +} + +static void clean_test_config(void *unused) +{ + GIT_UNUSED(unused); + cl_fixture_cleanup("./testconfig"); +} + +void test_config_read__multiline_value_and_eof(void) +{ + git_config *cfg; + + cl_set_cleanup(&clean_test_config, NULL); + cl_git_mkfile("./testconfig", "[header]\n key1 = foo\\\n"); + cl_git_pass(git_config_open_ondisk(&cfg, "./testconfig")); + + cl_git_pass(git_config_get_string_buf(&buf, cfg, "header.key1")); + cl_assert_equal_s("foo", git_buf_cstr(&buf)); + + git_config_free(cfg); +} + +void test_config_read__multiline_eof(void) +{ + git_config *cfg; + + cl_set_cleanup(&clean_test_config, NULL); + cl_git_mkfile("./testconfig", "[header]\n key1 = \\\n"); + cl_git_pass(git_config_open_ondisk(&cfg, "./testconfig")); + + cl_git_pass(git_config_get_string_buf(&buf, cfg, "header.key1")); + cl_assert_equal_s("", git_buf_cstr(&buf)); git_config_free(cfg); } @@ -66,15 +109,14 @@ void test_config_read__subsection_header(void) { git_config *cfg; - const char *str; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config3"))); - cl_git_pass(git_config_get_string(&str, cfg, "section.subsection.var")); - cl_assert_equal_s(str, "hello"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "section.subsection.var")); + cl_assert_equal_s("hello", git_buf_cstr(&buf)); /* The subsection is transformed to lower-case */ - cl_must_fail(git_config_get_string(&str, cfg, "section.subSectIon.var")); + cl_must_fail(git_config_get_string_buf(&buf, cfg, "section.subSectIon.var")); git_config_free(cfg); } @@ -82,21 +124,21 @@ void test_config_read__lone_variable(void) { git_config *cfg; - const char *str; int i; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config4"))); cl_git_fail(git_config_get_int32(&i, cfg, "some.section.variable")); - cl_git_pass(git_config_get_string(&str, cfg, "some.section.variable")); - cl_assert_equal_s(str, ""); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "some.section.variable")); + cl_assert_equal_s("", git_buf_cstr(&buf)); + git_buf_clear(&buf); cl_git_pass(git_config_get_bool(&i, cfg, "some.section.variable")); cl_assert(i == 1); - cl_git_pass(git_config_get_string(&str, cfg, "some.section.variableeq")); - cl_assert_equal_s(str, ""); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "some.section.variableeq")); + cl_assert_equal_s("", git_buf_cstr(&buf)); cl_git_pass(git_config_get_bool(&i, cfg, "some.section.variableeq")); cl_assert(i == 0); @@ -182,14 +224,14 @@ void test_config_read__prefixes(void) { git_config *cfg; - const char *str; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config9"))); - cl_git_pass(git_config_get_string(&str, cfg, "remote.ab.url")); - cl_assert_equal_s(str, "http://example.com/git/ab"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "remote.ab.url")); + cl_assert_equal_s("http://example.com/git/ab", git_buf_cstr(&buf)); + git_buf_clear(&buf); - cl_git_pass(git_config_get_string(&str, cfg, "remote.abba.url")); - cl_assert_equal_s(str, "http://example.com/git/abba"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "remote.abba.url")); + cl_assert_equal_s("http://example.com/git/abba", git_buf_cstr(&buf)); git_config_free(cfg); } @@ -197,11 +239,21 @@ void test_config_read__escaping_quotes(void) { git_config *cfg; - const char *str; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config13"))); - cl_git_pass(git_config_get_string(&str, cfg, "core.editor")); - cl_assert_equal_s("\"C:/Program Files/Nonsense/bah.exe\" \"--some option\"", str); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.editor")); + cl_assert_equal_s("\"C:/Program Files/Nonsense/bah.exe\" \"--some option\"", git_buf_cstr(&buf)); + + git_config_free(cfg); +} + +void test_config_read__invalid_escape_sequence(void) +{ + git_config *cfg; + + cl_set_cleanup(&clean_test_config, NULL); + cl_git_mkfile("./testconfig", "[header]\n key1 = \\\\\\;\n key2 = value2\n"); + cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig")); git_config_free(cfg); } @@ -343,6 +395,18 @@ git_config_iterator_free(iter); } +void test_config_read__iterator_invalid_glob(void) +{ + git_config *cfg; + git_config_iterator *iter; + + cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config9"))); + + cl_git_fail(git_config_iterator_glob_new(&iter, cfg, "*")); + + git_config_free(cfg); +} + void test_config_read__iterator_glob(void) { git_config *cfg; @@ -361,15 +425,15 @@ void test_config_read__whitespace_not_required_around_assignment(void) { git_config *cfg; - const char *str; cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config14"))); - cl_git_pass(git_config_get_string(&str, cfg, "a.b")); - cl_assert_equal_s(str, "c"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "a.b")); + cl_assert_equal_s("c", git_buf_cstr(&buf)); + git_buf_clear(&buf); - cl_git_pass(git_config_get_string(&str, cfg, "d.e")); - cl_assert_equal_s(str, "f"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "d.e")); + cl_assert_equal_s("f", git_buf_cstr(&buf)); git_config_free(cfg); } @@ -377,7 +441,7 @@ void test_config_read__read_git_config_entry(void) { git_config *cfg; - const git_config_entry *entry; + git_config_entry *entry; cl_git_pass(git_config_new(&cfg)); cl_git_pass(git_config_add_file_ondisk(cfg, cl_fixture("config/config9"), @@ -388,6 +452,7 @@ cl_assert_equal_s("42", entry->value); cl_assert_equal_i(GIT_CONFIG_LEVEL_SYSTEM, entry->level); + git_config_entry_free(entry); git_config_free(cfg); } @@ -478,7 +543,6 @@ git_config *cfg, *cfg_specific; int i; int64_t l, expected = +9223372036854775803; - const char *s; cl_git_pass(git_config_new(&cfg)); cl_git_pass(git_config_add_file_ondisk(cfg, cl_fixture("config/config18"), @@ -494,19 +558,13 @@ cl_assert(l == expected); cl_git_pass(git_config_get_bool(&i, cfg_specific, "core.boolglobal")); cl_assert_equal_b(true, i); - cl_git_pass(git_config_get_string(&s, cfg_specific, "core.stringglobal")); - cl_assert_equal_s("I'm a global config value!", s); + cl_git_pass(git_config_get_string_buf(&buf, cfg_specific, "core.stringglobal")); + cl_assert_equal_s("I'm a global config value!", git_buf_cstr(&buf)); git_config_free(cfg_specific); git_config_free(cfg); } -static void clean_test_config(void *unused) -{ - GIT_UNUSED(unused); - cl_fixture_cleanup("./testconfig"); -} - void test_config_read__can_load_and_parse_an_empty_config_file(void) { git_config *cfg; @@ -553,17 +611,95 @@ git_config_free(cfg); } +void test_config_read__invalid_key_chars(void) +{ + git_config *cfg; + + cl_set_cleanup(&clean_test_config, NULL); + cl_git_mkfile("./testconfig", "[foo]\n has_underscore = git2\n"); + cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig")); + + cl_git_rewritefile("./testconfig", "[foo]\n has/slash = git2\n"); + cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig")); + + cl_git_rewritefile("./testconfig", "[foo]\n has+plus = git2\n"); + cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig")); + + cl_git_rewritefile("./testconfig", "[no_key]\n = git2\n"); + cl_git_fail(git_config_open_ondisk(&cfg, "./testconfig")); + + git_config_free(cfg); +} + +void test_config_read__lone_variable_with_trailing_whitespace(void) +{ + git_config *cfg; + int b; + + cl_set_cleanup(&clean_test_config, NULL); + cl_git_mkfile("./testconfig", "[foo]\n lonevariable \n"); + cl_git_pass(git_config_open_ondisk(&cfg, "./testconfig")); + + cl_git_pass(git_config_get_bool(&b, cfg, "foo.lonevariable")); + cl_assert_equal_b(true, b); + + git_config_free(cfg); +} + void test_config_read__override_variable(void) { git_config *cfg; - const char *str; cl_set_cleanup(&clean_test_config, NULL); cl_git_mkfile("./testconfig", "[some] var = one\nvar = two"); cl_git_pass(git_config_open_ondisk(&cfg, "./testconfig")); - cl_git_pass(git_config_get_string(&str, cfg, "some.var")); - cl_assert_equal_s(str, "two"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "some.var")); + cl_assert_equal_s("two", git_buf_cstr(&buf)); + + git_config_free(cfg); +} +void test_config_read__path(void) +{ + git_config *cfg; + git_buf path = GIT_BUF_INIT; + git_buf old_path = GIT_BUF_INIT; + git_buf home_path = GIT_BUF_INIT; + git_buf expected_path = GIT_BUF_INIT; + + cl_git_pass(p_mkdir("fakehome", 0777)); + cl_git_pass(git_path_prettify(&home_path, "fakehome", NULL)); + cl_git_pass(git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, &old_path)); + cl_git_pass(git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, home_path.ptr)); + cl_git_mkfile("./testconfig", "[some]\n path = ~/somefile"); + cl_git_pass(git_path_join_unrooted(&expected_path, "somefile", home_path.ptr, NULL)); + + cl_git_pass(git_config_open_ondisk(&cfg, "./testconfig")); + cl_git_pass(git_config_get_path(&path, cfg, "some.path")); + cl_assert_equal_s(expected_path.ptr, path.ptr); + git_buf_free(&path); + + cl_git_mkfile("./testconfig", "[some]\n path = ~/"); + cl_git_pass(git_path_join_unrooted(&expected_path, "", home_path.ptr, NULL)); + + cl_git_pass(git_config_get_path(&path, cfg, "some.path")); + cl_assert_equal_s(expected_path.ptr, path.ptr); + git_buf_free(&path); + + cl_git_mkfile("./testconfig", "[some]\n path = ~"); + cl_git_pass(git_buf_sets(&expected_path, home_path.ptr)); + + cl_git_pass(git_config_get_path(&path, cfg, "some.path")); + cl_assert_equal_s(expected_path.ptr, path.ptr); + git_buf_free(&path); + + cl_git_mkfile("./testconfig", "[some]\n path = ~user/foo"); + cl_git_fail(git_config_get_path(&path, cfg, "some.path")); + + cl_git_pass(git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, old_path.ptr)); + git_buf_free(&old_path); + git_buf_free(&home_path); + git_buf_free(&expected_path); git_config_free(cfg); } diff -Nru libgit2-0.22.2/tests/config/rename.c libgit2-0.23.1/tests/config/rename.c --- libgit2-0.22.2/tests/config/rename.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/rename.c 2015-08-03 18:07:35.000000000 +0000 @@ -21,11 +21,12 @@ void test_config_rename__can_rename(void) { - const git_config_entry *ce; + git_config_entry *ce; cl_git_pass(git_config_get_entry( &ce, g_config, "branch.track-local.remote")); cl_assert_equal_s(".", ce->value); + git_config_entry_free(ce); cl_git_fail(git_config_get_entry( &ce, g_config, "branch.local-track.remote")); @@ -36,6 +37,7 @@ cl_git_pass(git_config_get_entry( &ce, g_config, "branch.local-track.remote")); cl_assert_equal_s(".", ce->value); + git_config_entry_free(ce); cl_git_fail(git_config_get_entry( &ce, g_config, "branch.track-local.remote")); @@ -43,7 +45,7 @@ void test_config_rename__prevent_overwrite(void) { - const git_config_entry *ce; + git_config_entry *ce; cl_git_pass(git_config_set_string( g_config, "branch.local-track.remote", "yellow")); @@ -51,6 +53,7 @@ cl_git_pass(git_config_get_entry( &ce, g_config, "branch.local-track.remote")); cl_assert_equal_s("yellow", ce->value); + git_config_entry_free(ce); cl_git_pass(git_config_rename_section( g_repo, "branch.track-local", "branch.local-track")); @@ -58,6 +61,7 @@ cl_git_pass(git_config_get_entry( &ce, g_config, "branch.local-track.remote")); cl_assert_equal_s(".", ce->value); + git_config_entry_free(ce); /* so, we don't currently prevent overwrite... */ /* { diff -Nru libgit2-0.22.2/tests/config/stress.c libgit2-0.23.1/tests/config/stress.c --- libgit2-0.22.2/tests/config/stress.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/stress.c 2015-08-03 18:07:35.000000000 +0000 @@ -6,6 +6,8 @@ #define TEST_CONFIG "git-test-config" +static git_buf buf = GIT_BUF_INIT; + void test_config_stress__initialize(void) { git_filebuf file = GIT_FILEBUF_INIT; @@ -20,50 +22,43 @@ void test_config_stress__cleanup(void) { + git_buf_free(&buf); p_unlink(TEST_CONFIG); } void test_config_stress__dont_break_on_invalid_input(void) { - const char *editor, *color; git_config *config; cl_assert(git_path_exists(TEST_CONFIG)); cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG)); - cl_git_pass(git_config_get_string(&color, config, "color.ui")); - cl_git_pass(git_config_get_string(&editor, config, "core.editor")); + cl_git_pass(git_config_get_string_buf(&buf, config, "color.ui")); + cl_git_pass(git_config_get_string_buf(&buf, config, "core.editor")); git_config_free(config); } +void assert_config_value(git_config *config, const char *key, const char *value) +{ + git_buf_clear(&buf); + cl_git_pass(git_config_get_string_buf(&buf, config, key)); + cl_assert_equal_s(value, git_buf_cstr(&buf)); +} + void test_config_stress__comments(void) { git_config *config; - const char *str; cl_git_pass(git_config_open_ondisk(&config, cl_fixture("config/config12"))); - cl_git_pass(git_config_get_string(&str, config, "some.section.test2")); - cl_assert_equal_s("hello", str); - - cl_git_pass(git_config_get_string(&str, config, "some.section.test3")); - cl_assert_equal_s("welcome", str); - - cl_git_pass(git_config_get_string(&str, config, "some.section.other")); - cl_assert_equal_s("hello! \" ; ; ; ", str); - - cl_git_pass(git_config_get_string(&str, config, "some.section.other2")); - cl_assert_equal_s("cool! \" # # # ", str); - - cl_git_pass(git_config_get_string(&str, config, "some.section.multi")); - cl_assert_equal_s("hi, this is a ; multiline comment # with ;\n special chars and other stuff !@#", str); - - cl_git_pass(git_config_get_string(&str, config, "some.section.multi2")); - cl_assert_equal_s("good, this is a ; multiline comment # with ;\n special chars and other stuff !@#", str); - - cl_git_pass(git_config_get_string(&str, config, "some.section.back")); - cl_assert_equal_s("this is \ba phrase", str); + assert_config_value(config, "some.section.test2", "hello"); + assert_config_value(config, "some.section.test3", "welcome"); + assert_config_value(config, "some.section.other", "hello! \" ; ; ; "); + assert_config_value(config, "some.section.other2", "cool! \" # # # "); + assert_config_value(config, "some.section.multi", "hi, this is a ; multiline comment # with ;\n special chars and other stuff !@#"); + assert_config_value(config, "some.section.multi2", "good, this is a ; multiline comment # with ;\n special chars and other stuff !@#"); + assert_config_value(config, "some.section.back", "this is \ba phrase"); git_config_free(config); } @@ -71,7 +66,6 @@ void test_config_stress__escape_subsection_names(void) { git_config *config; - const char *str; cl_assert(git_path_exists("git-test-config")); cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG)); @@ -81,15 +75,14 @@ cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG)); - cl_git_pass(git_config_get_string(&str, config, "some.sec\\tion.other")); - cl_assert_equal_s("foo", str); + assert_config_value(config, "some.sec\\tion.other", "foo"); + git_config_free(config); } void test_config_stress__trailing_backslash(void) { git_config *config; - const char *str; const char *path = "C:\\iam\\some\\windows\\path\\"; cl_assert(git_path_exists("git-test-config")); @@ -98,20 +91,19 @@ git_config_free(config); cl_git_pass(git_config_open_ondisk(&config, TEST_CONFIG)); - cl_git_pass(git_config_get_string(&str, config, "windows.path")); - cl_assert_equal_s(path, str); + assert_config_value(config, "windows.path", path); + git_config_free(config); } void test_config_stress__complex(void) { git_config *config; - const char *str; const char *path = "./config-immediate-multiline"; cl_git_mkfile(path, "[imm]\n multi = \"\\\nfoo\""); cl_git_pass(git_config_open_ondisk(&config, path)); - cl_git_pass(git_config_get_string(&str, config, "imm.multi")); - cl_assert_equal_s(str, "foo"); + assert_config_value(config, "imm.multi", "foo"); + git_config_free(config); } diff -Nru libgit2-0.22.2/tests/config/validkeyname.c libgit2-0.23.1/tests/config/validkeyname.c --- libgit2-0.22.2/tests/config/validkeyname.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/validkeyname.c 2015-08-03 18:07:35.000000000 +0000 @@ -3,7 +3,6 @@ #include "config.h" static git_config *cfg; -static const char *value; void test_config_validkeyname__initialize(void) { @@ -22,7 +21,9 @@ static void assert_invalid_config_key_name(const char *name) { - cl_git_fail_with(git_config_get_string(&value, cfg, name), + git_buf buf = GIT_BUF_INIT; + + cl_git_fail_with(git_config_get_string_buf(&buf, cfg, name), GIT_EINVALIDSPEC); cl_git_fail_with(git_config_set_string(cfg, name, "42"), GIT_EINVALIDSPEC); diff -Nru libgit2-0.22.2/tests/config/write.c libgit2-0.23.1/tests/config/write.c --- libgit2-0.22.2/tests/config/write.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/config/write.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,4 +1,6 @@ #include "clar_libgit2.h" +#include "buffer.h" +#include "fileops.h" void test_config_write__initialize(void) { @@ -105,18 +107,190 @@ git_config_free(cfg); } -void test_config_write__write_subsection(void) +/* + * This test exposes a bug where duplicate empty section headers could prevent + * deletion of config entries. + */ +void test_config_write__delete_value_with_duplicate_header(void) { + const char *file_name = "config-duplicate-header"; + const char *entry_name = "remote.origin.url"; git_config *cfg; + git_config_entry *entry; + + /* This config can occur after removing and re-adding the origin remote */ + const char *file_content = + "[remote \"origin\"]\n" \ + "[branch \"master\"]\n" \ + " remote = \"origin\"\n" \ + "[remote \"origin\"]\n" \ + " url = \"foo\"\n"; + + /* Write the test config and make sure the expected entry exists */ + cl_git_mkfile(file_name, file_content); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_get_entry(&entry, cfg, entry_name)); + + /* Delete that entry */ + cl_git_pass(git_config_delete_entry(cfg, entry_name)); + + /* Reopen the file and make sure the entry no longer exists */ + git_config_entry_free(entry); + git_config_free(cfg); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_fail(git_config_get_entry(&entry, cfg, entry_name)); + + /* Cleanup */ + git_config_entry_free(entry); + git_config_free(cfg); +} + +/* + * This test exposes a bug where duplicate section headers could cause + * config_write to add a new entry when one already exists. + */ +void test_config_write__add_value_with_duplicate_header(void) +{ + const char *file_name = "config-duplicate-insert"; + const char *entry_name = "foo.c"; + const char *old_val = "old"; + const char *new_val = "new"; const char *str; + git_config *cfg, *snapshot; + + /* c = old should be replaced by c = new. + * The bug causes c = new to be inserted under the first 'foo' header. + */ + const char *file_content = + "[foo]\n" \ + " a = b\n" \ + "[other]\n" \ + " a = b\n" \ + "[foo]\n" \ + " c = old\n"; + + /* Write the test config */ + cl_git_mkfile(file_name, file_content); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + + /* make sure the expected entry (foo.c) exists */ + cl_git_pass(git_config_snapshot(&snapshot, cfg)); + cl_git_pass(git_config_get_string(&str, snapshot, entry_name)); + cl_assert_equal_s(old_val, str); + git_config_free(snapshot); + + /* Try setting foo.c to something else */ + cl_git_pass(git_config_set_string(cfg, entry_name, new_val)); + git_config_free(cfg); + + /* Reopen the file and make sure the new value was set */ + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_snapshot(&snapshot, cfg)); + cl_git_pass(git_config_get_string(&str, snapshot, entry_name)); + cl_assert_equal_s(new_val, str); + + /* Cleanup */ + git_config_free(snapshot); + git_config_free(cfg); +} + +void test_config_write__overwrite_value_with_duplicate_header(void) +{ + const char *file_name = "config-duplicate-header"; + const char *entry_name = "remote.origin.url"; + git_config *cfg; + git_config_entry *entry; + + /* This config can occur after removing and re-adding the origin remote */ + const char *file_content = + "[remote \"origin\"]\n" \ + "[branch \"master\"]\n" \ + " remote = \"origin\"\n" \ + "[remote \"origin\"]\n" \ + " url = \"foo\"\n"; + + /* Write the test config and make sure the expected entry exists */ + cl_git_mkfile(file_name, file_content); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_get_entry(&entry, cfg, entry_name)); + + /* Update that entry */ + cl_git_pass(git_config_set_string(cfg, entry_name, "newurl")); + + /* Reopen the file and make sure the entry was updated */ + git_config_entry_free(entry); + git_config_free(cfg); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_get_entry(&entry, cfg, entry_name)); + + cl_assert_equal_s("newurl", entry->value); + + /* Cleanup */ + git_config_entry_free(entry); + git_config_free(cfg); +} + +static int multivar_cb(const git_config_entry *entry, void *data) +{ + int *n = (int *)data; + + cl_assert_equal_s(entry->value, "newurl"); + + (*n)++; + + return 0; +} + +void test_config_write__overwrite_multivar_within_duplicate_header(void) +{ + const char *file_name = "config-duplicate-header"; + const char *entry_name = "remote.origin.url"; + git_config *cfg; + git_config_entry *entry; + int n = 0; + + /* This config can occur after removing and re-adding the origin remote */ + const char *file_content = + "[remote \"origin\"]\n" \ + " url = \"bar\"\n" \ + "[branch \"master\"]\n" \ + " remote = \"origin\"\n" \ + "[remote \"origin\"]\n" \ + " url = \"foo\"\n"; + + /* Write the test config and make sure the expected entry exists */ + cl_git_mkfile(file_name, file_content); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_get_entry(&entry, cfg, entry_name)); + + /* Update that entry */ + cl_git_pass(git_config_set_multivar(cfg, entry_name, ".*", "newurl")); + git_config_entry_free(entry); + git_config_free(cfg); + + /* Reopen the file and make sure the entry was updated */ + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_get_multivar_foreach(cfg, entry_name, NULL, multivar_cb, &n)); + cl_assert_equal_i(2, n); + + /* Cleanup */ + git_config_free(cfg); +} + +void test_config_write__write_subsection(void) +{ + git_config *cfg; + git_buf buf = GIT_BUF_INIT; cl_git_pass(git_config_open_ondisk(&cfg, "config9")); cl_git_pass(git_config_set_string(cfg, "my.own.var", "works")); git_config_free(cfg); cl_git_pass(git_config_open_ondisk(&cfg, "config9")); - cl_git_pass(git_config_get_string(&str, cfg, "my.own.var")); - cl_assert_equal_s("works", str); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "my.own.var")); + cl_assert_equal_s("works", git_buf_cstr(&buf)); + + git_buf_free(&buf); git_config_free(cfg); } @@ -132,46 +306,52 @@ void test_config_write__value_containing_quotes(void) { git_config *cfg; - const char* str; + git_buf buf = GIT_BUF_INIT; cl_git_pass(git_config_open_ondisk(&cfg, "config9")); cl_git_pass(git_config_set_string(cfg, "core.somevar", "this \"has\" quotes")); - cl_git_pass(git_config_get_string(&str, cfg, "core.somevar")); - cl_assert_equal_s(str, "this \"has\" quotes"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar")); + cl_assert_equal_s("this \"has\" quotes", git_buf_cstr(&buf)); + git_buf_clear(&buf); git_config_free(cfg); cl_git_pass(git_config_open_ondisk(&cfg, "config9")); - cl_git_pass(git_config_get_string(&str, cfg, "core.somevar")); - cl_assert_equal_s(str, "this \"has\" quotes"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar")); + cl_assert_equal_s("this \"has\" quotes", git_buf_cstr(&buf)); + git_buf_clear(&buf); git_config_free(cfg); /* The code path for values that already exist is different, check that one as well */ cl_git_pass(git_config_open_ondisk(&cfg, "config9")); cl_git_pass(git_config_set_string(cfg, "core.somevar", "this also \"has\" quotes")); - cl_git_pass(git_config_get_string(&str, cfg, "core.somevar")); - cl_assert_equal_s(str, "this also \"has\" quotes"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar")); + cl_assert_equal_s("this also \"has\" quotes", git_buf_cstr(&buf)); + git_buf_clear(&buf); git_config_free(cfg); cl_git_pass(git_config_open_ondisk(&cfg, "config9")); - cl_git_pass(git_config_get_string(&str, cfg, "core.somevar")); - cl_assert_equal_s(str, "this also \"has\" quotes"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar")); + cl_assert_equal_s("this also \"has\" quotes", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); } void test_config_write__escape_value(void) { git_config *cfg; - const char* str; + git_buf buf = GIT_BUF_INIT; cl_git_pass(git_config_open_ondisk(&cfg, "config9")); cl_git_pass(git_config_set_string(cfg, "core.somevar", "this \"has\" quotes and \t")); - cl_git_pass(git_config_get_string(&str, cfg, "core.somevar")); - cl_assert_equal_s(str, "this \"has\" quotes and \t"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar")); + cl_assert_equal_s("this \"has\" quotes and \t", git_buf_cstr(&buf)); + git_buf_clear(&buf); git_config_free(cfg); cl_git_pass(git_config_open_ondisk(&cfg, "config9")); - cl_git_pass(git_config_get_string(&str, cfg, "core.somevar")); - cl_assert_equal_s(str, "this \"has\" quotes and \t"); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar")); + cl_assert_equal_s("this \"has\" quotes and \t", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); } @@ -180,7 +360,7 @@ git_config *cfg, *cfg_specific; int i; int64_t l, expected = +9223372036854775803; - const char *s; + git_buf buf = GIT_BUF_INIT; // open config15 as global level config file cl_git_pass(git_config_new(&cfg)); @@ -207,9 +387,10 @@ cl_assert(l == expected); cl_git_pass(git_config_get_bool(&i, cfg, "core.boolglobal")); cl_assert_equal_b(true, i); - cl_git_pass(git_config_get_string(&s, cfg, "core.stringglobal")); - cl_assert_equal_s("I'm a global config value!", s); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.stringglobal")); + cl_assert_equal_s("I'm a global config value!", git_buf_cstr(&buf)); + git_buf_free(&buf); git_config_free(cfg); } @@ -247,7 +428,7 @@ void test_config_write__add_value_which_needs_quotes(void) { - git_config *cfg; + git_config *cfg, *base; const char* str1; const char* str2; const char* str3; @@ -262,7 +443,8 @@ cl_git_pass(git_config_set_string(cfg, "core.startwhithsapceandcontainsdoublequote", " some\"thing")); git_config_free(cfg); - cl_git_pass(git_config_open_ondisk(&cfg, "config17")); + cl_git_pass(git_config_open_ondisk(&base, "config17")); + cl_git_pass(git_config_snapshot(&cfg, base)); cl_git_pass(git_config_get_string(&str1, cfg, "core.startwithspace")); cl_assert_equal_s(" Something", str1); cl_git_pass(git_config_get_string(&str2, cfg, "core.endwithspace")); @@ -274,6 +456,7 @@ cl_git_pass(git_config_get_string(&str5, cfg, "core.startwhithsapceandcontainsdoublequote")); cl_assert_equal_s(" some\"thing", str5); git_config_free(cfg); + git_config_free(base); } void test_config_write__can_set_a_value_to_NULL(void) @@ -294,15 +477,16 @@ { git_repository *repository; git_config *config; - const char * str; + git_buf buf = {0}; repository = cl_git_sandbox_init("testrepo.git"); cl_git_pass(git_repository_config(&config, repository)); cl_git_pass(git_config_set_string(config, "core.somevar", "")); - cl_git_pass(git_config_get_string(&str, config, "core.somevar")); - cl_assert_equal_s(str, ""); + cl_git_pass(git_config_get_string_buf(&buf, config, "core.somevar")); + cl_assert_equal_s("", buf.ptr); + git_buf_free(&buf); git_config_free(config); cl_git_sandbox_cleanup(); } @@ -342,3 +526,107 @@ git_config_free(cfg); } + +#define SECTION_FOO \ + "\n" \ + " \n" \ + " [section \"foo\"] \n" \ + " # here's a comment\n" \ + "\tname = \"value\"\n" \ + " name2 = \"value2\"\n" \ + "; another comment!\n" + +#define SECTION_BAR \ + "[section \"bar\"]\t\n" \ + "\t \n" \ + " barname=\"value\"\n" + + +void test_config_write__preserves_whitespace_and_comments(void) +{ + const char *file_name = "config-duplicate-header"; + const char *n; + git_config *cfg; + git_buf newfile = GIT_BUF_INIT; + + /* This config can occur after removing and re-adding the origin remote */ + const char *file_content = SECTION_FOO SECTION_BAR; + + /* Write the test config and make sure the expected entry exists */ + cl_git_mkfile(file_name, file_content); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_set_string(cfg, "section.foo.other", "otherval")); + cl_git_pass(git_config_set_string(cfg, "newsection.newname", "new_value")); + + /* Ensure that we didn't needlessly mangle the config file */ + cl_git_pass(git_futils_readbuffer(&newfile, file_name)); + n = newfile.ptr; + + cl_assert_equal_strn(SECTION_FOO, n, strlen(SECTION_FOO)); + n += strlen(SECTION_FOO); + + cl_assert_equal_strn("\tother = otherval\n", n, strlen("\tother = otherval\n")); + n += strlen("\tother = otherval\n"); + + cl_assert_equal_strn(SECTION_BAR, n, strlen(SECTION_BAR)); + n += strlen(SECTION_BAR); + + cl_assert_equal_s("[newsection]\n\tnewname = new_value\n", n); + + git_buf_free(&newfile); + git_config_free(cfg); +} + +void test_config_write__preserves_entry_with_name_only(void) +{ + const char *file_name = "config-empty-value"; + git_config *cfg; + git_buf newfile = GIT_BUF_INIT; + + /* Write the test config and make sure the expected entry exists */ + cl_git_mkfile(file_name, "[section \"foo\"]\n\tname\n"); + cl_git_pass(git_config_open_ondisk(&cfg, file_name)); + cl_git_pass(git_config_set_string(cfg, "newsection.newname", "new_value")); + cl_git_pass(git_config_set_string(cfg, "section.foo.other", "otherval")); + + cl_git_pass(git_futils_readbuffer(&newfile, file_name)); + cl_assert_equal_s("[section \"foo\"]\n\tname\n\tother = otherval\n[newsection]\n\tnewname = new_value\n", newfile.ptr); + + git_buf_free(&newfile); + git_config_free(cfg); +} + +void test_config_write__to_empty_file(void) +{ + git_config *cfg; + const char *filename = "config-file"; + git_buf result = GIT_BUF_INIT; + + cl_git_mkfile(filename, ""); + cl_git_pass(git_config_open_ondisk(&cfg, filename)); + cl_git_pass(git_config_set_string(cfg, "section.name", "value")); + git_config_free(cfg); + + cl_git_pass(git_futils_readbuffer(&result, "config-file")); + cl_assert_equal_s("[section]\n\tname = value\n", result.ptr); + + git_buf_free(&result); +} + +void test_config_write__to_file_with_only_comment(void) +{ + git_config *cfg; + const char *filename = "config-file"; + git_buf result = GIT_BUF_INIT; + + cl_git_mkfile(filename, "\n\n"); + cl_git_pass(git_config_open_ondisk(&cfg, filename)); + cl_git_pass(git_config_set_string(cfg, "section.name", "value")); + git_config_free(cfg); + + cl_git_pass(git_futils_readbuffer(&result, "config-file")); + cl_assert_equal_s("\n\n[section]\n\tname = value\n", result.ptr); + + git_buf_free(&result); +} + diff -Nru libgit2-0.22.2/tests/core/buffer.c libgit2-0.23.1/tests/core/buffer.c --- libgit2-0.22.2/tests/core/buffer.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/buffer.c 2015-08-03 18:07:35.000000000 +0000 @@ -1054,14 +1054,20 @@ git_buf_sets(&src, "crlf\r\ncrlf\r\ncrlf\r\ncrlf\r\n"); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf("crlf\r\ncrlf\r\ncrlf\r\ncrlf\r\n", tgt); + + git_buf_sets(&src, "crlf\r\ncrlf\r\ncrlf\r\ncrlf\r\n"); cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf("crlf\ncrlf\ncrlf\ncrlf\n", tgt); git_buf_sets(&src, "\r\ncrlf\r\ncrlf\r\ncrlf\r\ncrlf\r\ncrlf"); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf("\r\ncrlf\r\ncrlf\r\ncrlf\r\ncrlf\r\ncrlf", tgt); + + git_buf_sets(&src, "\r\ncrlf\r\ncrlf\r\ncrlf\r\ncrlf\r\ncrlf"); cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf("\ncrlf\ncrlf\ncrlf\ncrlf\ncrlf", tgt); @@ -1070,7 +1076,11 @@ git_buf_sets(&src, "\nlf\nlf\ncrlf\r\nlf\nlf\ncrlf\r\n"); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf("\r\nlf\r\nlf\r\ncrlf\r\nlf\r\nlf\r\ncrlf\r\n", tgt); + + git_buf_sets(&src, "\nlf\nlf\ncrlf\r\nlf\nlf\ncrlf\r\n"); + cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf("\nlf\nlf\ncrlf\nlf\nlf\ncrlf\n", tgt); @@ -1078,7 +1088,9 @@ git_buf_sets(&src, "\ncrlf\r\ncrlf\r\nlf\ncrlf\r\ncrlf"); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf("\r\ncrlf\r\ncrlf\r\nlf\r\ncrlf\r\ncrlf", tgt); + cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf("\ncrlf\ncrlf\nlf\ncrlf\ncrlf", tgt); @@ -1086,7 +1098,11 @@ git_buf_sets(&src, "\rcrlf\r\nlf\nlf\ncr\rcrlf\r\nlf\ncr\r"); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf("\rcrlf\r\nlf\r\nlf\r\ncr\rcrlf\r\nlf\r\ncr\r", tgt); + + git_buf_sets(&src, "\rcrlf\r\nlf\nlf\ncr\rcrlf\r\nlf\ncr\r"); + cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf("\rcrlf\nlf\nlf\ncr\rcrlf\nlf\ncr\r", tgt); @@ -1102,7 +1118,9 @@ /* blob correspondence tests */ git_buf_sets(&src, ALL_CRLF_TEXT_RAW); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf(ALL_CRLF_TEXT_AS_CRLF, tgt); + git_buf_sets(&src, ALL_CRLF_TEXT_RAW); cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf(ALL_CRLF_TEXT_AS_LF, tgt); git_buf_free(&src); @@ -1111,22 +1129,40 @@ git_buf_sets(&src, ALL_LF_TEXT_RAW); cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); check_buf(ALL_LF_TEXT_AS_CRLF, tgt); + git_buf_sets(&src, ALL_LF_TEXT_RAW); cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf(ALL_LF_TEXT_AS_LF, tgt); git_buf_free(&src); git_buf_free(&tgt); git_buf_sets(&src, MORE_CRLF_TEXT_RAW); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf(MORE_CRLF_TEXT_AS_CRLF, tgt); + git_buf_sets(&src, MORE_CRLF_TEXT_RAW); cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf(MORE_CRLF_TEXT_AS_LF, tgt); git_buf_free(&src); git_buf_free(&tgt); git_buf_sets(&src, MORE_LF_TEXT_RAW); - cl_git_fail_with(GIT_PASSTHROUGH, git_buf_text_lf_to_crlf(&tgt, &src)); + cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src)); + check_buf(MORE_LF_TEXT_AS_CRLF, tgt); + git_buf_sets(&src, MORE_LF_TEXT_RAW); cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src)); check_buf(MORE_LF_TEXT_AS_LF, tgt); git_buf_free(&src); git_buf_free(&tgt); } + +void test_core_buffer__dont_grow_borrowed(void) +{ + const char *somestring = "blah blah"; + git_buf buf = GIT_BUF_INIT; + + git_buf_attach_notowned(&buf, somestring, strlen(somestring) + 1); + cl_assert_equal_p(somestring, buf.ptr); + cl_assert_equal_i(0, buf.asize); + cl_assert_equal_i(strlen(somestring) + 1, buf.size); + + cl_git_fail_with(GIT_EINVALID, git_buf_grow(&buf, 1024)); +} diff -Nru libgit2-0.22.2/tests/core/dirent.c libgit2-0.23.1/tests/core/dirent.c --- libgit2-0.22.2/tests/core/dirent.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/dirent.c 2015-08-03 18:07:35.000000000 +0000 @@ -67,10 +67,23 @@ } } +static int update_count(name_data *data, const char *name) +{ + name_data *n; + + for (n = data; n->name; n++) { + if (!strcmp(n->name, name)) { + n->count++; + return 0; + } + } + + return GIT_ERROR; +} + static int one_entry(void *state, git_buf *path) { walk_data *d = (walk_data *) state; - name_data *n; if (state != state_loc) return GIT_ERROR; @@ -78,14 +91,7 @@ if (path != &d->path) return GIT_ERROR; - for (n = d->names; n->name; n++) { - if (!strcmp(n->name, path->ptr)) { - n->count++; - return 0; - } - } - - return GIT_ERROR; + return update_count(d->names, path->ptr); } @@ -234,3 +240,38 @@ cl_must_pass(p_rmdir("empty_dir")); } + +static void handle_next(git_path_diriter *diriter, walk_data *walk) +{ + const char *fullpath, *filename; + size_t fullpath_len, filename_len; + + cl_git_pass(git_path_diriter_fullpath(&fullpath, &fullpath_len, diriter)); + cl_git_pass(git_path_diriter_filename(&filename, &filename_len, diriter)); + + cl_assert_equal_strn(fullpath, "sub/", 4); + cl_assert_equal_s(fullpath+4, filename); + + update_count(walk->names, fullpath); +} + +/* test directory iterator */ +void test_core_dirent__diriter_with_fullname(void) +{ + git_path_diriter diriter = GIT_PATH_DIRITER_INIT; + int error; + + cl_set_cleanup(&dirent_cleanup__cb, &sub); + setup(&sub); + + cl_git_pass(git_path_diriter_init(&diriter, sub.path.ptr, 0)); + + while ((error = git_path_diriter_next(&diriter)) == 0) + handle_next(&diriter, &sub); + + cl_assert_equal_i(error, GIT_ITEROVER); + + git_path_diriter_free(&diriter); + + check_counts(&sub); +} diff -Nru libgit2-0.22.2/tests/core/errors.c libgit2-0.23.1/tests/core/errors.c --- libgit2-0.22.2/tests/core/errors.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/errors.c 2015-08-03 18:07:35.000000000 +0000 @@ -109,3 +109,68 @@ cl_assert_equal_i(42, giterr_last()->klass); cl_assert_equal_s("Foo: bar", giterr_last()->message); } + +static int test_arraysize_multiply(size_t nelem, size_t size) +{ + size_t out; + GITERR_CHECK_ALLOC_MULTIPLY(&out, nelem, size); + return 0; +} + +void test_core_errors__integer_overflow_alloc_multiply(void) +{ + cl_git_pass(test_arraysize_multiply(10, 10)); + cl_git_pass(test_arraysize_multiply(1000, 1000)); + cl_git_pass(test_arraysize_multiply(SIZE_MAX/sizeof(void *), sizeof(void *))); + cl_git_pass(test_arraysize_multiply(0, 10)); + cl_git_pass(test_arraysize_multiply(10, 0)); + + cl_git_fail(test_arraysize_multiply(SIZE_MAX-1, sizeof(void *))); + cl_git_fail(test_arraysize_multiply((SIZE_MAX/sizeof(void *))+1, sizeof(void *))); + + cl_assert_equal_i(GITERR_NOMEMORY, giterr_last()->klass); + cl_assert_equal_s("Out of memory", giterr_last()->message); +} + +static int test_arraysize_add(size_t one, size_t two) +{ + size_t out; + GITERR_CHECK_ALLOC_ADD(&out, one, two); + return 0; +} + +void test_core_errors__integer_overflow_alloc_add(void) +{ + cl_git_pass(test_arraysize_add(10, 10)); + cl_git_pass(test_arraysize_add(1000, 1000)); + cl_git_pass(test_arraysize_add(SIZE_MAX-10, 10)); + + cl_git_fail(test_arraysize_multiply(SIZE_MAX-1, 2)); + cl_git_fail(test_arraysize_multiply(SIZE_MAX, SIZE_MAX)); + + cl_assert_equal_i(GITERR_NOMEMORY, giterr_last()->klass); + cl_assert_equal_s("Out of memory", giterr_last()->message); +} + +void test_core_errors__integer_overflow_sets_oom(void) +{ + size_t out; + + giterr_clear(); + cl_assert(!GIT_ADD_SIZET_OVERFLOW(&out, SIZE_MAX-1, 1)); + cl_assert_equal_p(NULL, giterr_last()); + + giterr_clear(); + cl_assert(!GIT_ADD_SIZET_OVERFLOW(&out, 42, 69)); + cl_assert_equal_p(NULL, giterr_last()); + + giterr_clear(); + cl_assert(GIT_ADD_SIZET_OVERFLOW(&out, SIZE_MAX, SIZE_MAX)); + cl_assert_equal_i(GITERR_NOMEMORY, giterr_last()->klass); + cl_assert_equal_s("Out of memory", giterr_last()->message); + + giterr_clear(); + cl_assert(GIT_ADD_SIZET_OVERFLOW(&out, SIZE_MAX, SIZE_MAX)); + cl_assert_equal_i(GITERR_NOMEMORY, giterr_last()->klass); + cl_assert_equal_s("Out of memory", giterr_last()->message); +} diff -Nru libgit2-0.22.2/tests/core/features.c libgit2-0.23.1/tests/core/features.c --- libgit2-0.22.2/tests/core/features.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/features.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,7 +17,7 @@ cl_assert((caps & GIT_FEATURE_THREADS) == 0); #endif -#if defined(GIT_SSL) || defined(GIT_WINHTTP) +#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT) cl_assert((caps & GIT_FEATURE_HTTPS) != 0); #else cl_assert((caps & GIT_FEATURE_HTTPS) == 0); diff -Nru libgit2-0.22.2/tests/core/filebuf.c libgit2-0.23.1/tests/core/filebuf.c --- libgit2-0.22.2/tests/core/filebuf.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/filebuf.c 2015-08-03 18:07:35.000000000 +0000 @@ -124,3 +124,30 @@ cl_must_pass(p_unlink(test)); } +void test_core_filebuf__rename_error(void) +{ + git_filebuf file = GIT_FILEBUF_INIT; + char *dir = "subdir", *test = "subdir/test", *test_lock = "subdir/test.lock"; + int fd; + +#ifndef GIT_WIN32 + cl_skip(); +#endif + + cl_git_pass(p_mkdir(dir, 0666)); + cl_git_mkfile(test, "dummy content"); + fd = p_open(test, O_RDONLY); + cl_assert(fd > 0); + cl_git_pass(git_filebuf_open(&file, test, 0, 0666)); + + cl_git_pass(git_filebuf_printf(&file, "%s\n", "libgit2 rocks")); + + cl_assert_equal_i(true, git_path_exists(test_lock)); + + cl_git_fail(git_filebuf_commit(&file)); + p_close(fd); + + git_filebuf_cleanup(&file); + + cl_assert_equal_i(false, git_path_exists(test_lock)); +} diff -Nru libgit2-0.22.2/tests/core/ftruncate.c libgit2-0.23.1/tests/core/ftruncate.c --- libgit2-0.22.2/tests/core/ftruncate.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/core/ftruncate.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,48 @@ +/** + * Some tests for p_ftruncate() to ensure that + * properly handles large (2Gb+) files. + */ + +#include "clar_libgit2.h" + +static const char *filename = "core_ftruncate.txt"; +static int fd = -1; + +void test_core_ftruncate__initialize(void) +{ + if (!cl_getenv("GITTEST_INVASIVE_FS_SIZE")) + cl_skip(); + + cl_must_pass((fd = p_open(filename, O_CREAT | O_RDWR, 0644))); +} + +void test_core_ftruncate__cleanup(void) +{ + if (fd < 0) + return; + + p_close(fd); + fd = 0; + + p_unlink(filename); +} + +static void _extend(git_off_t i64len) +{ + struct stat st; + int error; + + cl_assert((error = p_ftruncate(fd, i64len)) == 0); + cl_assert((error = p_fstat(fd, &st)) == 0); + cl_assert(st.st_size == i64len); +} + +void test_core_ftruncate__2gb(void) +{ + _extend(0x80000001); +} + +void test_core_ftruncate__4gb(void) +{ + _extend(0x100000001); +} diff -Nru libgit2-0.22.2/tests/core/iconv.c libgit2-0.23.1/tests/core/iconv.c --- libgit2-0.22.2/tests/core/iconv.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/iconv.c 2015-08-03 18:07:35.000000000 +0000 @@ -24,7 +24,7 @@ void test_core_iconv__unchanged(void) { #ifdef GIT_USE_ICONV - char *data = "Ascii data", *original = data; + const char *data = "Ascii data", *original = data; size_t datalen = strlen(data); cl_git_pass(git_path_iconv(&ic, &data, &datalen)); @@ -38,7 +38,7 @@ void test_core_iconv__decomposed_to_precomposed(void) { #ifdef GIT_USE_ICONV - char *data = nfd; + const char *data = nfd; size_t datalen, nfdlen = strlen(nfd); datalen = nfdlen; @@ -64,7 +64,7 @@ void test_core_iconv__precomposed_is_unmodified(void) { #ifdef GIT_USE_ICONV - char *data = nfc; + const char *data = nfc; size_t datalen = strlen(nfc); cl_git_pass(git_path_iconv(&ic, &data, &datalen)); diff -Nru libgit2-0.22.2/tests/core/mkdir.c libgit2-0.23.1/tests/core/mkdir.c --- libgit2-0.22.2/tests/core/mkdir.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/mkdir.c 2015-08-03 18:07:35.000000000 +0000 @@ -103,7 +103,7 @@ { mode_t *mode = ref; - if (*mode != 0) { + if (mode != NULL) { (void)p_umask(*mode); git__free(mode); } diff -Nru libgit2-0.22.2/tests/core/oidmap.c libgit2-0.23.1/tests/core/oidmap.c --- libgit2-0.22.2/tests/core/oidmap.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/oidmap.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,7 +1,7 @@ #include "clar_libgit2.h" #include "oidmap.h" -GIT__USE_OIDMAP; +GIT__USE_OIDMAP typedef struct { git_oid oid; diff -Nru libgit2-0.22.2/tests/core/path.c libgit2-0.23.1/tests/core/path.c --- libgit2-0.22.2/tests/core/path.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/path.c 2015-08-03 18:07:35.000000000 +0000 @@ -492,7 +492,7 @@ { git_buf p = GIT_BUF_INIT; - cl_must_pass(git_path_exists(NON_EXISTING_FILEPATH) == false); + cl_assert_equal_b(git_path_exists(NON_EXISTING_FILEPATH), false); cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH, NULL)); cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH "/so-do-i", NULL)); diff -Nru libgit2-0.22.2/tests/core/posix.c libgit2-0.23.1/tests/core/posix.c --- libgit2-0.22.2/tests/core/posix.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/posix.c 2015-08-03 18:07:35.000000000 +0000 @@ -97,3 +97,52 @@ cl_git_fail(p_inet_pton(5, "315.124", NULL)); /* AF_CHAOS */ cl_assert_equal_i(EAFNOSUPPORT, errno); } + +void test_core_posix__utimes(void) +{ + struct timeval times[2]; + struct stat st; + time_t curtime; + int fd; + + /* test p_utimes */ + times[0].tv_sec = 1234567890; + times[0].tv_usec = 0; + times[1].tv_sec = 1234567890; + times[1].tv_usec = 0; + + cl_git_mkfile("foo", "Dummy file."); + cl_must_pass(p_utimes("foo", times)); + + p_stat("foo", &st); + cl_assert_equal_i(1234567890, st.st_atime); + cl_assert_equal_i(1234567890, st.st_mtime); + + + /* test p_futimes */ + times[0].tv_sec = 1414141414; + times[0].tv_usec = 0; + times[1].tv_sec = 1414141414; + times[1].tv_usec = 0; + + cl_must_pass(fd = p_open("foo", O_RDWR)); + cl_must_pass(p_futimes(fd, times)); + p_close(fd); + + p_stat("foo", &st); + cl_assert_equal_i(1414141414, st.st_atime); + cl_assert_equal_i(1414141414, st.st_mtime); + + + /* test p_utimes with current time, assume that + * it takes < 5 seconds to get the time...! + */ + cl_must_pass(p_utimes("foo", NULL)); + + curtime = time(NULL); + p_stat("foo", &st); + cl_assert((st.st_atime - curtime) < 5); + cl_assert((st.st_mtime - curtime) < 5); + + p_unlink("foo"); +} diff -Nru libgit2-0.22.2/tests/core/string.c libgit2-0.23.1/tests/core/string.c --- libgit2-0.22.2/tests/core/string.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/string.c 2015-08-03 18:07:35.000000000 +0000 @@ -39,3 +39,45 @@ cl_assert(git__strcasesort_cmp("BAR", "foo") < 0); cl_assert(git__strcasesort_cmp("fooBar", "foobar") < 0); } + +void test_core_string__strcmp(void) +{ + cl_assert(git__strcmp("", "") == 0); + cl_assert(git__strcmp("foo", "foo") == 0); + cl_assert(git__strcmp("Foo", "foo") < 0); + cl_assert(git__strcmp("foo", "FOO") > 0); + cl_assert(git__strcmp("foo", "fOO") > 0); + + cl_assert(strcmp("rt\303\202of", "rt dev\302\266h") > 0); + cl_assert(strcmp("e\342\202\254ghi=", "et") > 0); + cl_assert(strcmp("rt dev\302\266h", "rt\303\202of") < 0); + cl_assert(strcmp("et", "e\342\202\254ghi=") < 0); + cl_assert(strcmp("\303\215", "\303\255") < 0); + + cl_assert(git__strcmp("rt\303\202of", "rt dev\302\266h") > 0); + cl_assert(git__strcmp("e\342\202\254ghi=", "et") > 0); + cl_assert(git__strcmp("rt dev\302\266h", "rt\303\202of") < 0); + cl_assert(git__strcmp("et", "e\342\202\254ghi=") < 0); + cl_assert(git__strcmp("\303\215", "\303\255") < 0); +} + +void test_core_string__strcasecmp(void) +{ + cl_assert(git__strcasecmp("", "") == 0); + cl_assert(git__strcasecmp("foo", "foo") == 0); + cl_assert(git__strcasecmp("foo", "Foo") == 0); + cl_assert(git__strcasecmp("foo", "FOO") == 0); + cl_assert(git__strcasecmp("foo", "fOO") == 0); + + cl_assert(strcasecmp("rt\303\202of", "rt dev\302\266h") > 0); + cl_assert(strcasecmp("e\342\202\254ghi=", "et") > 0); + cl_assert(strcasecmp("rt dev\302\266h", "rt\303\202of") < 0); + cl_assert(strcasecmp("et", "e\342\202\254ghi=") < 0); + cl_assert(strcasecmp("\303\215", "\303\255") < 0); + + cl_assert(git__strcasecmp("rt\303\202of", "rt dev\302\266h") > 0); + cl_assert(git__strcasecmp("e\342\202\254ghi=", "et") > 0); + cl_assert(git__strcasecmp("rt dev\302\266h", "rt\303\202of") < 0); + cl_assert(git__strcasecmp("et", "e\342\202\254ghi=") < 0); + cl_assert(git__strcasecmp("\303\215", "\303\255") < 0); +} diff -Nru libgit2-0.22.2/tests/core/strmap.c libgit2-0.23.1/tests/core/strmap.c --- libgit2-0.22.2/tests/core/strmap.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/core/strmap.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,7 +1,7 @@ #include "clar_libgit2.h" #include "strmap.h" -GIT__USE_STRMAP; +GIT__USE_STRMAP git_strmap *g_table; diff -Nru libgit2-0.22.2/tests/core/structinit.c libgit2-0.23.1/tests/core/structinit.c --- libgit2-0.22.2/tests/core/structinit.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/core/structinit.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,168 @@ +#include "clar_libgit2.h" +#include +#include +#include +#include + +#define STRINGIFY(s) #s + +/* Checks two conditions for the specified structure: + * 1. That the initializers for the latest version produces the same + * in-memory representation. + * 2. That the function-based initializer supports all versions from 1...n, + * where n is the latest version (often represented by GIT_*_VERSION). + * + * Parameters: + * structname: The name of the structure to test, e.g. git_blame_options. + * structver: The latest version of the specified structure. + * macroinit: The macro that initializes the latest version of the structure. + * funcinitname: The function that initializes the structure. Must have the + * signature "int (structname* instance, int version)". + */ +#define CHECK_MACRO_FUNC_INIT_EQUAL(structname, structver, macroinit, funcinitname) \ +do { \ + structname structname##_macro_latest = macroinit; \ + structname structname##_func_latest; \ + int structname##_curr_ver = structver - 1; \ + memset(&structname##_func_latest, 0, sizeof(structname##_func_latest)); \ + cl_git_pass(funcinitname(&structname##_func_latest, structver)); \ + options_cmp(&structname##_macro_latest, &structname##_func_latest, \ + sizeof(structname), STRINGIFY(structname)); \ + \ + while (structname##_curr_ver > 0) \ + { \ + structname macro; \ + cl_git_pass(funcinitname(¯o, structname##_curr_ver)); \ + structname##_curr_ver--; \ + }\ +} while(0) + +static void options_cmp(void *one, void *two, size_t size, const char *name) +{ + size_t i; + + for (i = 0; i < size; i++) { + if (((char *)one)[i] != ((char *)two)[i]) { + char desc[1024]; + + p_snprintf(desc, 1024, "Difference in %s at byte %" PRIuZ ": macro=%u / func=%u", + name, i, ((char *)one)[i], ((char *)two)[i]); + clar__fail(__FILE__, __LINE__, + "Difference between macro and function options initializer", + desc, 0); + return; + } + } +} + +void test_core_structinit__compare(void) +{ + /* These tests assume that they can memcmp() two structures that were + * initialized with the same static initializer. Eg, + * git_blame_options = GIT_BLAME_OPTIONS_INIT; + * + * This assumption fails when there is padding between structure members, + * which is not guaranteed to be initialized to anything sane at all. + * + * Assume most compilers, in a debug build, will clear that memory for + * us or set it to sentinal markers. Etc. + */ +#if !defined(DEBUG) && !defined(_DEBUG) + clar__skip(); +#endif + + /* blame */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_blame_options, GIT_BLAME_OPTIONS_VERSION, \ + GIT_BLAME_OPTIONS_INIT, git_blame_init_options); + + /* checkout */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, \ + GIT_CHECKOUT_OPTIONS_INIT, git_checkout_init_options); + + /* clone */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_clone_options, GIT_CLONE_OPTIONS_VERSION, \ + GIT_CLONE_OPTIONS_INIT, git_clone_init_options); + + /* diff */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_diff_options, GIT_DIFF_OPTIONS_VERSION, \ + GIT_DIFF_OPTIONS_INIT, git_diff_init_options); + + /* diff_find */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_diff_find_options, GIT_DIFF_FIND_OPTIONS_VERSION, \ + GIT_DIFF_FIND_OPTIONS_INIT, git_diff_find_init_options); + + /* merge_file_input */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_merge_file_input, GIT_MERGE_FILE_INPUT_VERSION, \ + GIT_MERGE_FILE_INPUT_INIT, git_merge_file_init_input); + + /* merge_file */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_merge_file_options, GIT_MERGE_FILE_OPTIONS_VERSION, \ + GIT_MERGE_FILE_OPTIONS_INIT, git_merge_file_init_options); + + /* merge_tree */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_merge_options, GIT_MERGE_OPTIONS_VERSION, \ + GIT_MERGE_OPTIONS_INIT, git_merge_init_options); + + /* push */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_push_options, GIT_PUSH_OPTIONS_VERSION, \ + GIT_PUSH_OPTIONS_INIT, git_push_init_options); + + /* remote */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_remote_callbacks, GIT_REMOTE_CALLBACKS_VERSION, \ + GIT_REMOTE_CALLBACKS_INIT, git_remote_init_callbacks); + + /* repository_init */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_repository_init_options, GIT_REPOSITORY_INIT_OPTIONS_VERSION, \ + GIT_REPOSITORY_INIT_OPTIONS_INIT, git_repository_init_init_options); + + /* revert */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_revert_options, GIT_REVERT_OPTIONS_VERSION, \ + GIT_REVERT_OPTIONS_INIT, git_revert_init_options); + + /* stash apply */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_stash_apply_options, GIT_STASH_APPLY_OPTIONS_VERSION, \ + GIT_STASH_APPLY_OPTIONS_INIT, git_stash_apply_init_options); + + /* status */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_status_options, GIT_STATUS_OPTIONS_VERSION, \ + GIT_STATUS_OPTIONS_INIT, git_status_init_options); + + /* transport */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_transport, GIT_TRANSPORT_VERSION, \ + GIT_TRANSPORT_INIT, git_transport_init); + + /* config_backend */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_config_backend, GIT_CONFIG_BACKEND_VERSION, \ + GIT_CONFIG_BACKEND_INIT, git_config_init_backend); + + /* odb_backend */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_odb_backend, GIT_ODB_BACKEND_VERSION, \ + GIT_ODB_BACKEND_INIT, git_odb_init_backend); + + /* refdb_backend */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_refdb_backend, GIT_REFDB_BACKEND_VERSION, \ + GIT_REFDB_BACKEND_INIT, git_refdb_init_backend); + + /* submodule update */ + CHECK_MACRO_FUNC_INIT_EQUAL( \ + git_submodule_update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \ + GIT_SUBMODULE_UPDATE_OPTIONS_INIT, git_submodule_update_init_options); +} diff -Nru libgit2-0.22.2/tests/describe/describe.c libgit2-0.23.1/tests/describe/describe.c --- libgit2-0.22.2/tests/describe/describe.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/describe/describe.c 2015-08-03 18:07:35.000000000 +0000 @@ -28,7 +28,7 @@ return 0; } -void test_describe_describe__cannot_describe_against_a_repo_with_no_ref(void) +void test_describe_describe__describe_a_repo_with_no_refs(void) { git_repository *repo; git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT; @@ -41,8 +41,13 @@ cl_git_pass(git_reference_foreach(repo, delete_cb, NULL)); + /* Impossible to describe without falling back to OIDs */ cl_git_fail(git_describe_commit(&result, object, &opts)); + /* Try again with OID fallbacks */ + opts.show_commit_oid_as_fallback = 1; + cl_git_pass(git_describe_commit(&result, object, &opts)); + git_describe_result_free(result); git_object_free(object); git_buf_free(&buf); diff -Nru libgit2-0.22.2/tests/describe/t6120.c libgit2-0.23.1/tests/describe/t6120.c --- libgit2-0.22.2/tests/describe/t6120.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/describe/t6120.c 2015-08-03 18:07:35.000000000 +0000 @@ -113,7 +113,7 @@ if (tag_name == NULL) return; - cl_git_pass(git_reference_create(&ref, repo, tag_name, &commit_id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, repo, tag_name, &commit_id, 0, NULL)); git_reference_free(ref); } diff -Nru libgit2-0.22.2/tests/diff/binary.c libgit2-0.23.1/tests/diff/binary.c --- libgit2-0.22.2/tests/diff/binary.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/binary.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,7 +1,10 @@ #include "clar_libgit2.h" +#include "git2/sys/diff.h" + #include "buffer.h" #include "filebuf.h" +#include "repository.h" static git_repository *repo; @@ -49,6 +52,11 @@ cl_assert_equal_s(expected, actual.ptr); + git_buf_clear(&actual); + cl_git_pass(git_diff_print(diff, GIT_DIFF_FORMAT_PATCH, git_diff_print_callback__to_buf, &actual)); + + cl_assert_equal_s(expected, actual.ptr); + git_buf_free(&actual); git_patch_free(patch); git_diff_free(diff); @@ -261,3 +269,270 @@ git_index_free(index); } + +void test_diff_binary__empty_for_no_diff(void) +{ + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_oid id; + git_commit *commit; + git_tree *tree; + git_diff *diff; + git_buf actual = GIT_BUF_INIT; + + opts.flags = GIT_DIFF_SHOW_BINARY | GIT_DIFF_FORCE_BINARY; + opts.id_abbrev = GIT_OID_HEXSZ; + + repo = cl_git_sandbox_init("renames"); + + cl_git_pass(git_oid_fromstr(&id, "19dd32dfb1520a64e5bbaae8dce6ef423dfa2f13")); + cl_git_pass(git_commit_lookup(&commit, repo, &id)); + cl_git_pass(git_commit_tree(&tree, commit)); + + cl_git_pass(git_diff_tree_to_tree(&diff, repo, tree, tree, &opts)); + cl_git_pass(git_diff_print(diff, GIT_DIFF_FORMAT_PATCH, git_diff_print_callback__to_buf, &actual)); + + cl_assert_equal_s("", actual.ptr); + + git_buf_free(&actual); + git_diff_free(diff); + git_commit_free(commit); + git_tree_free(tree); +} + +void test_diff_binary__index_to_workdir(void) +{ + git_index *index; + git_diff *diff; + git_patch *patch; + git_buf actual = GIT_BUF_INIT; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + const char *expected = + "diff --git a/untimely.txt b/untimely.txt\n" \ + "index 9a69d960ae94b060f56c2a8702545e2bb1abb935..1111d4f11f4b35bf6759e0fb714fe09731ef0840 100644\n" \ + "GIT binary patch\n" \ + "delta 32\n" \ + "nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW\n" \ + "\n" \ + "delta 7\n" \ + "Oc%18D`@*{63ljhg(E~C7\n"; + + opts.flags = GIT_DIFF_SHOW_BINARY | GIT_DIFF_FORCE_BINARY; + opts.id_abbrev = GIT_OID_HEXSZ; + + repo = cl_git_sandbox_init("renames"); + cl_git_pass(git_repository_index(&index, repo)); + + cl_git_append2file("renames/untimely.txt", "Oh that crazy Kipling!\r\n"); + + cl_git_pass(git_diff_index_to_workdir(&diff, repo, index, &opts)); + + cl_git_pass(git_patch_from_diff(&patch, diff, 0)); + cl_git_pass(git_patch_to_buf(&actual, patch)); + + cl_assert_equal_s(expected, actual.ptr); + + cl_git_pass(git_index_add_bypath(index, "untimely.txt")); + cl_git_pass(git_index_write(index)); + + test_patch( + "19dd32dfb1520a64e5bbaae8dce6ef423dfa2f13", + NULL, + &opts, + expected); + + git_buf_free(&actual); + git_patch_free(patch); + git_diff_free(diff); + git_index_free(index); +} + +static int print_cb( + const git_diff_delta *delta, + const git_diff_hunk *hunk, + const git_diff_line *line, + void *payload) +{ + git_buf *buf = (git_buf *)payload; + + GIT_UNUSED(delta); + + if (hunk) + git_buf_put(buf, hunk->header, hunk->header_len); + + if (line) + git_buf_put(buf, line->content, line->content_len); + + return git_buf_oom(buf) ? -1 : 0; +} + +void test_diff_binary__print_patch_from_diff(void) +{ + git_index *index; + git_diff *diff; + git_buf actual = GIT_BUF_INIT; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + const char *expected = + "diff --git a/untimely.txt b/untimely.txt\n" \ + "index 9a69d960ae94b060f56c2a8702545e2bb1abb935..1111d4f11f4b35bf6759e0fb714fe09731ef0840 100644\n" \ + "GIT binary patch\n" \ + "delta 32\n" \ + "nc%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW\n" \ + "\n" \ + "delta 7\n" \ + "Oc%18D`@*{63ljhg(E~C7\n"; + + opts.flags = GIT_DIFF_SHOW_BINARY | GIT_DIFF_FORCE_BINARY; + opts.id_abbrev = GIT_OID_HEXSZ; + + repo = cl_git_sandbox_init("renames"); + cl_git_pass(git_repository_index(&index, repo)); + + cl_git_append2file("renames/untimely.txt", "Oh that crazy Kipling!\r\n"); + + cl_git_pass(git_diff_index_to_workdir(&diff, repo, index, &opts)); + + cl_git_pass(git_diff_print(diff, GIT_DIFF_FORMAT_PATCH, print_cb, &actual)); + + cl_assert_equal_s(expected, actual.ptr); + + git_buf_free(&actual); + git_diff_free(diff); + git_index_free(index); +} + +struct diff_data { + char *old_path; + git_oid old_id; + git_buf old_binary_base85; + size_t old_binary_inflatedlen; + git_diff_binary_t old_binary_type; + + char *new_path; + git_oid new_id; + git_buf new_binary_base85; + size_t new_binary_inflatedlen; + git_diff_binary_t new_binary_type; +}; + +static int file_cb( + const git_diff_delta *delta, + float progress, + void *payload) +{ + struct diff_data *diff_data = payload; + + GIT_UNUSED(progress); + + if (delta->old_file.path) + diff_data->old_path = git__strdup(delta->old_file.path); + + if (delta->new_file.path) + diff_data->new_path = git__strdup(delta->new_file.path); + + git_oid_cpy(&diff_data->old_id, &delta->old_file.id); + git_oid_cpy(&diff_data->new_id, &delta->new_file.id); + + return 0; +} + +static int binary_cb( + const git_diff_delta *delta, + const git_diff_binary *binary, + void *payload) +{ + struct diff_data *diff_data = payload; + + GIT_UNUSED(delta); + + git_buf_encode_base85(&diff_data->old_binary_base85, + binary->old_file.data, binary->old_file.datalen); + diff_data->old_binary_inflatedlen = binary->old_file.inflatedlen; + diff_data->old_binary_type = binary->old_file.type; + + git_buf_encode_base85(&diff_data->new_binary_base85, + binary->new_file.data, binary->new_file.datalen); + diff_data->new_binary_inflatedlen = binary->new_file.inflatedlen; + diff_data->new_binary_type = binary->new_file.type; + + return 0; +} + +static int hunk_cb( + const git_diff_delta *delta, + const git_diff_hunk *hunk, + void *payload) +{ + GIT_UNUSED(delta); + GIT_UNUSED(hunk); + GIT_UNUSED(payload); + + cl_fail("did not expect hunk callback"); + return 0; +} + +static int line_cb( + const git_diff_delta *delta, + const git_diff_hunk *hunk, + const git_diff_line *line, + void *payload) +{ + GIT_UNUSED(delta); + GIT_UNUSED(hunk); + GIT_UNUSED(line); + GIT_UNUSED(payload); + + cl_fail("did not expect line callback"); + return 0; +} + +void test_diff_binary__blob_to_blob(void) +{ + git_index *index; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_blob *old_blob, *new_blob; + git_oid old_id, new_id; + struct diff_data diff_data = {0}; + + opts.flags = GIT_DIFF_SHOW_BINARY | GIT_DIFF_FORCE_BINARY; + opts.id_abbrev = GIT_OID_HEXSZ; + + repo = cl_git_sandbox_init("renames"); + cl_git_pass(git_repository_index__weakptr(&index, repo)); + + cl_git_append2file("renames/untimely.txt", "Oh that crazy Kipling!\r\n"); + cl_git_pass(git_index_add_bypath(index, "untimely.txt")); + cl_git_pass(git_index_write(index)); + + git_oid_fromstr(&old_id, "9a69d960ae94b060f56c2a8702545e2bb1abb935"); + git_oid_fromstr(&new_id, "1111d4f11f4b35bf6759e0fb714fe09731ef0840"); + + cl_git_pass(git_blob_lookup(&old_blob, repo, &old_id)); + cl_git_pass(git_blob_lookup(&new_blob, repo, &new_id)); + + cl_git_pass(git_diff_blobs(old_blob, + "untimely.txt", new_blob, "untimely.txt", &opts, + file_cb, binary_cb, hunk_cb, line_cb, &diff_data)); + + cl_assert_equal_s("untimely.txt", diff_data.old_path); + cl_assert_equal_oid(&old_id, &diff_data.old_id); + cl_assert_equal_i(GIT_DIFF_BINARY_DELTA, diff_data.old_binary_type); + cl_assert_equal_i(7, diff_data.old_binary_inflatedlen); + cl_assert_equal_s("c%18D`@*{63ljhg(E~C7", + diff_data.old_binary_base85.ptr); + + cl_assert_equal_s("untimely.txt", diff_data.new_path); + cl_assert_equal_oid(&new_id, &diff_data.new_id); + cl_assert_equal_i(GIT_DIFF_BINARY_DELTA, diff_data.new_binary_type); + cl_assert_equal_i(32, diff_data.new_binary_inflatedlen); + cl_assert_equal_s("c%1vf+QYWt3zLL@hC)e3Vu?a>QDRl4f_G*?PG(-ZA}<#J$+QbW", + diff_data.new_binary_base85.ptr); + + git_blob_free(old_blob); + git_blob_free(new_blob); + + git__free(diff_data.old_path); + git__free(diff_data.new_path); + + git_buf_free(&diff_data.old_binary_base85); + git_buf_free(&diff_data.new_binary_base85); +} diff -Nru libgit2-0.22.2/tests/diff/blob.c libgit2-0.23.1/tests/diff/blob.c --- libgit2-0.22.2/tests/diff/blob.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/blob.c 2015-08-03 18:07:35.000000000 +0000 @@ -17,7 +17,7 @@ cl_git_pass(git_diff_blob_to_buffer( blob, blob_path, str, len, str_path, - &opts, diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + &opts, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); } void test_diff_blob__initialize(void) @@ -33,11 +33,11 @@ /* tests/resources/attr/root_test4.txt */ cl_git_pass(git_oid_fromstrn(&oid, "a0f7217a", 8)); - cl_git_pass(git_blob_lookup_prefix(&d, g_repo, &oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&d, g_repo, &oid, 8)); /* alien.png */ cl_git_pass(git_oid_fromstrn(&oid, "edf3dcee", 8)); - cl_git_pass(git_blob_lookup_prefix(&alien, g_repo, &oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&alien, g_repo, &oid, 8)); } void test_diff_blob__cleanup(void) @@ -80,7 +80,7 @@ /* tests/resources/attr/root_test3 */ cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16)); - cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 8)); + cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 16)); /* Doing the equivalent of a `git diff -U1` on these files */ @@ -88,7 +88,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( a, NULL, b, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(1, 6, 1, 5, 0, &expected); /* same diff but use direct buffers */ @@ -96,27 +96,27 @@ cl_git_pass(git_diff_buffers( git_blob_rawcontent(a), (size_t)git_blob_rawsize(a), NULL, git_blob_rawcontent(b), (size_t)git_blob_rawsize(b), NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(1, 6, 1, 5, 0, &expected); /* diff on tests/resources/attr/root_test2 */ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( b, NULL, c, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(1, 15, 3, 9, 3, &expected); /* diff on tests/resources/attr/root_test3 */ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( a, NULL, c, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(1, 13, 0, 12, 1, &expected); memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( c, NULL, d, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(2, 14, 4, 6, 4, &expected); git_blob_free(a); @@ -163,15 +163,15 @@ /* tests/resources/attr/root_test1 */ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); - cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8)); /* tests/resources/attr/root_test2 */ cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8)); - cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 8)); /* tests/resources/attr/root_test3 */ cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16)); - cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 8)); + cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 16)); /* Doing the equivalent of a `git diff -U1` on these files */ @@ -206,7 +206,7 @@ cl_git_pass(git_diff_blobs( d, NULL, e, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_DELETED]); @@ -222,7 +222,7 @@ cl_git_pass(git_diff_blobs( d, NULL, e, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.file_status[GIT_DELTA_ADDED]); @@ -238,7 +238,7 @@ cl_git_pass(git_diff_blobs( alien, NULL, NULL, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.files_binary); @@ -250,7 +250,7 @@ cl_git_pass(git_diff_blobs( NULL, NULL, alien, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(1, expected.files); cl_assert_equal_i(1, expected.files_binary); @@ -358,7 +358,7 @@ cl_git_pass(git_diff_blobs( d, NULL, d, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_identical_blobs_comparison(&expected); cl_assert_equal_i(0, expected.files_binary); @@ -366,7 +366,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( NULL, NULL, NULL, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_identical_blobs_comparison(&expected); cl_assert_equal_i(0, expected.files_binary); @@ -374,7 +374,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( alien, NULL, alien, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_identical_blobs_comparison(&expected); cl_assert(expected.files_binary > 0); @@ -437,11 +437,11 @@ /* heart.png */ cl_git_pass(git_oid_fromstrn(&h_oid, "de863bff", 8)); - cl_git_pass(git_blob_lookup_prefix(&heart, g_repo, &h_oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&heart, g_repo, &h_oid, 8)); cl_git_pass(git_diff_blobs( alien, NULL, heart, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_binary_blobs_comparison(&expected); @@ -449,7 +449,7 @@ cl_git_pass(git_diff_blobs( heart, NULL, alien, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_binary_blobs_comparison(&expected); @@ -460,7 +460,7 @@ { cl_git_pass(git_diff_blobs( alien, NULL, d, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_binary_blobs_comparison(&expected); @@ -468,7 +468,7 @@ cl_git_pass(git_diff_blobs( d, NULL, alien, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_binary_blobs_comparison(&expected); } @@ -505,12 +505,12 @@ /* tests/resources/attr/root_test1 from commit f5b0af1 */ cl_git_pass(git_oid_fromstrn(&old_d_oid, "fe773770", 8)); - cl_git_pass(git_blob_lookup_prefix(&old_d, g_repo, &old_d_oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&old_d, g_repo, &old_d_oid, 8)); /* Test with default inter-hunk-context (not set) => default is 0 */ cl_git_pass(git_diff_blobs( old_d, NULL, d, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(2, expected.hunks); @@ -519,7 +519,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( old_d, NULL, d, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(2, expected.hunks); @@ -528,7 +528,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( old_d, NULL, d, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); cl_assert_equal_i(1, expected.hunks); @@ -542,7 +542,7 @@ opts.version = 0; cl_git_fail(git_diff_blobs( d, NULL, alien, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); err = giterr_last(); cl_assert_equal_i(GITERR_INVALID, err->klass); } @@ -554,7 +554,7 @@ opts.version = 1024; cl_git_fail(git_diff_blobs( d, NULL, alien, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); err = giterr_last(); cl_assert_equal_i(GITERR_INVALID, err->klass); } @@ -598,7 +598,7 @@ /* tests/resources/attr/root_test1 */ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); - cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8)); /* diff from blob a to content of b */ quick_diff_blob_to_str(a, NULL, b_content, 0, NULL); @@ -640,7 +640,7 @@ /* tests/resources/attr/root_test1 */ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8)); - cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8)); /* diff from blob a to content of b */ cl_git_pass(git_patch_from_blob_and_buffer( @@ -719,10 +719,10 @@ opts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8)); - cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 8)); cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8)); - cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 8)); /* non-binary to reference content */ @@ -752,7 +752,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( bin, NULL, nonbin, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_binary_blobs_comparison(&expected); /* @@ -773,7 +773,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_blobs( bin, NULL, nonbin, NULL, &opts, - diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified_with_lines(&expected, 4); /* cleanup */ @@ -825,11 +825,11 @@ opts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED; cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8)); - cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 8)); /* 20b: "Hello from the root\n" */ cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8)); - cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 4)); + cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 8)); /* 33b: "0123456789\n\x01\x02\x03\x04\x05\x06\x07\x08\x09\n0123456789\n" */ /* non-binary to reference content */ @@ -993,8 +993,8 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_buffers( - a, strlen(a), NULL, b, strlen(b), NULL, - &opts, diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + a, strlen(a), NULL, b, strlen(b), NULL, &opts, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(4, 9, 0, 4, 5, &expected); opts.flags ^= GIT_DIFF_REVERSE; @@ -1002,7 +1002,7 @@ memset(&expected, 0, sizeof(expected)); cl_git_pass(git_diff_buffers( - a, strlen(a), NULL, b, strlen(b), NULL, - &opts, diff_file_cb, diff_hunk_cb, diff_line_cb, &expected)); + a, strlen(a), NULL, b, strlen(b), NULL, &opts, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expected)); assert_one_modified(4, 9, 0, 5, 4, &expected); } diff -Nru libgit2-0.22.2/tests/diff/diff_helpers.c libgit2-0.23.1/tests/diff/diff_helpers.c --- libgit2-0.22.2/tests/diff/diff_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/diff_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -68,7 +68,7 @@ if ((delta->flags & GIT_DIFF_FLAG_BINARY) != 0) e->files_binary++; - cl_assert(delta->status <= GIT_DELTA_TYPECHANGE); + cl_assert(delta->status <= GIT_DELTA_CONFLICTED); e->file_status[delta->status] += 1; @@ -91,6 +91,18 @@ return diff_file_cb(delta, progress, payload); } +int diff_binary_cb( + const git_diff_delta *delta, + const git_diff_binary *binary, + void *payload) +{ + GIT_UNUSED(delta); + GIT_UNUSED(binary); + GIT_UNUSED(payload); + + return 0; +} + int diff_hunk_cb( const git_diff_delta *delta, const git_diff_hunk *hunk, @@ -145,12 +157,15 @@ int diff_foreach_via_iterator( git_diff *diff, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *data) { size_t d, num_d = git_diff_num_deltas(diff); + GIT_UNUSED(binary_cb); + for (d = 0; d < num_d; ++d) { git_patch *patch; const git_diff_delta *delta; diff -Nru libgit2-0.22.2/tests/diff/diff_helpers.h libgit2-0.23.1/tests/diff/diff_helpers.h --- libgit2-0.22.2/tests/diff/diff_helpers.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/diff_helpers.h 2015-08-03 18:07:35.000000000 +0000 @@ -8,7 +8,7 @@ int files; int files_binary; - int file_status[10]; /* indexed by git_delta_t value */ + int file_status[11]; /* indexed by git_delta_t value */ int hunks; int hunk_new_lines; @@ -42,6 +42,11 @@ float progress, void *cb_data); +extern int diff_binary_cb( + const git_diff_delta *delta, + const git_diff_binary *binary, + void *cb_data); + extern int diff_hunk_cb( const git_diff_delta *delta, const git_diff_hunk *hunk, @@ -56,6 +61,7 @@ extern int diff_foreach_via_iterator( git_diff *diff, git_diff_file_cb file_cb, + git_diff_binary_cb binary_cb, git_diff_hunk_cb hunk_cb, git_diff_line_cb line_cb, void *data); diff -Nru libgit2-0.22.2/tests/diff/drivers.c libgit2-0.23.1/tests/diff/drivers.c --- libgit2-0.22.2/tests/diff/drivers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/drivers.c 2015-08-03 18:07:35.000000000 +0000 @@ -186,7 +186,7 @@ g_repo = cl_git_sandbox_init("userdiff"); - cl_git_pass(git_path_dirload("userdiff/files", 9, 0, 0, &files)); + cl_git_pass(git_path_dirload(&files, "userdiff/files", 9, 0)); opts.interhunk_lines = 1; opts.context_lines = 1; diff -Nru libgit2-0.22.2/tests/diff/index.c libgit2-0.23.1/tests/diff/index.c --- libgit2-0.22.2/tests/diff/index.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/index.c 2015-08-03 18:07:35.000000000 +0000 @@ -35,7 +35,7 @@ cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, NULL, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); /* to generate these values: * - cd to tests/resources/status, @@ -63,7 +63,7 @@ cl_git_pass(git_diff_tree_to_index(&diff, g_repo, b, NULL, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); /* to generate these values: * - cd to tests/resources/status, @@ -127,8 +127,8 @@ cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, NULL, &opts)); - cl_assert_equal_i( - 1, git_diff_foreach(diff, diff_stop_after_2_files, NULL, NULL, &exp) ); + cl_assert_equal_i(1, git_diff_foreach( + diff, diff_stop_after_2_files, NULL, NULL, NULL, &exp) ); cl_assert_equal_i(2, exp.files); @@ -163,3 +163,108 @@ git_tree_free(a); } +static void do_conflicted_diff(diff_expects *exp, unsigned long flags) +{ + const char *a_commit = "26a125ee1bf"; /* the current HEAD */ + git_tree *a = resolve_commit_oid_to_tree(g_repo, a_commit); + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_index_entry ancestor = {{0}}, ours = {{0}}, theirs = {{0}}; + git_diff *diff = NULL; + git_index *index; + + cl_assert(a); + + opts.context_lines = 1; + opts.interhunk_lines = 1; + opts.flags |= flags; + + memset(exp, 0, sizeof(diff_expects)); + + cl_git_pass(git_repository_index(&index, g_repo)); + + ancestor.path = ours.path = theirs.path = "staged_changes"; + ancestor.mode = ours.mode = theirs.mode = GIT_FILEMODE_BLOB; + + git_oid_fromstr(&ancestor.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&ours.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&theirs.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + + cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs)); + cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, &opts)); + + cl_git_pass(git_diff_foreach( + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, exp)); + + git_diff_free(diff); + git_tree_free(a); + git_index_free(index); +} + +void test_diff_index__reports_conflicts(void) +{ + diff_expects exp; + + do_conflicted_diff(&exp, 0); + + cl_assert_equal_i(8, exp.files); + cl_assert_equal_i(3, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(2, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_CONFLICTED]); + + cl_assert_equal_i(7, exp.hunks); + + cl_assert_equal_i(9, exp.lines); + cl_assert_equal_i(2, exp.line_ctxt); + cl_assert_equal_i(5, exp.line_adds); + cl_assert_equal_i(2, exp.line_dels); +} + +void test_diff_index__reports_conflicts_when_reversed(void) +{ + diff_expects exp; + + do_conflicted_diff(&exp, GIT_DIFF_REVERSE); + + cl_assert_equal_i(8, exp.files); + cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(3, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_CONFLICTED]); + + cl_assert_equal_i(7, exp.hunks); + + cl_assert_equal_i(9, exp.lines); + cl_assert_equal_i(2, exp.line_ctxt); + cl_assert_equal_i(2, exp.line_adds); + cl_assert_equal_i(5, exp.line_dels); +} + +void test_diff_index__not_in_head_conflicted(void) +{ + const char *a_commit = "26a125ee1bf"; /* the current HEAD */ + git_index_entry theirs = {{0}}; + git_index *index; + git_diff *diff; + const git_diff_delta *delta; + + git_tree *a = resolve_commit_oid_to_tree(g_repo, a_commit); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_read_tree(index, a)); + + theirs.path = "file_not_in_head"; + theirs.mode = GIT_FILEMODE_BLOB; + git_oid_fromstr(&theirs.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + cl_git_pass(git_index_conflict_add(index, NULL, NULL, &theirs)); + + cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, NULL)); + + cl_assert_equal_i(git_diff_num_deltas(diff), 1); + delta = git_diff_get_delta(diff, 0); + cl_assert_equal_i(delta->status, GIT_DELTA_CONFLICTED); + + git_diff_free(diff); + git_index_free(index); + git_tree_free(a); +} diff -Nru libgit2-0.22.2/tests/diff/notify.c libgit2-0.23.1/tests/diff/notify.c --- libgit2-0.22.2/tests/diff/notify.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/notify.c 2015-08-03 18:07:35.000000000 +0000 @@ -59,7 +59,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(expected_diffed_files_count, exp.files); @@ -222,7 +222,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(0, exp.files); diff -Nru libgit2-0.22.2/tests/diff/rename.c libgit2-0.23.1/tests/diff/rename.c --- libgit2-0.22.2/tests/diff/rename.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/rename.c 2015-08-03 18:07:35.000000000 +0000 @@ -65,7 +65,7 @@ */ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -81,7 +81,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -102,7 +102,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -124,7 +124,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -204,7 +204,7 @@ */ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -222,7 +222,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -243,7 +243,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -266,7 +266,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -297,7 +297,7 @@ */ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -317,7 +317,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -344,7 +344,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -369,7 +369,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -381,37 +381,53 @@ git_tree_free(new_tree); } -void test_diff_rename__handles_small_files(void) +void test_diff_rename__test_small_files(void) { - const char *tree_sha = "2bc7f351d20b53f1c72c16c4b036e491c478c49a"; git_index *index; - git_tree *tree; + git_reference *head_reference; + git_commit *head_commit; + git_tree *head_tree; + git_tree *commit_tree; + git_signature *signature; git_diff *diff; - git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; - git_diff_find_options opts = GIT_DIFF_FIND_OPTIONS_INIT; + git_oid oid; + const git_diff_delta *delta; + git_diff_options diff_options = GIT_DIFF_OPTIONS_INIT; + git_diff_find_options find_options = GIT_DIFF_FIND_OPTIONS_INIT; cl_git_pass(git_repository_index(&index, g_repo)); - tree = resolve_commit_oid_to_tree(g_repo, tree_sha); - - cl_git_rewritefile("renames/songof7cities.txt", "single line\n"); - cl_git_pass(git_index_add_bypath(index, "songof7cities.txt")); - - cl_git_rewritefile("renames/untimely.txt", "untimely\n"); - cl_git_pass(git_index_add_bypath(index, "untimely.txt")); - - /* Tests that we can invoke find_similar on small files - * and that the GIT_EBUFS (too small) error code is not - * propagated to the caller. - */ - cl_git_pass(git_diff_tree_to_index(&diff, g_repo, tree, index, &diffopts)); + cl_git_mkfile("renames/small.txt", "Hello World!\n"); + cl_git_pass(git_index_add_bypath(index, "small.txt")); - opts.flags = GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES | - GIT_DIFF_FIND_AND_BREAK_REWRITES; - cl_git_pass(git_diff_find_similar(diff, &opts)); - - git_diff_free(diff); - git_tree_free(tree); + cl_git_pass(git_repository_head(&head_reference, g_repo)); + cl_git_pass(git_reference_peel((git_object**)&head_commit, head_reference, GIT_OBJ_COMMIT)); + cl_git_pass(git_commit_tree(&head_tree, head_commit)); + cl_git_pass(git_index_write_tree(&oid, index)); + cl_git_pass(git_tree_lookup(&commit_tree, g_repo, &oid)); + cl_git_pass(git_signature_new(&signature, "Rename", "rename@example.com", 1404157834, 0)); + cl_git_pass(git_commit_create(&oid, g_repo, "HEAD", signature, signature, NULL, "Test commit", commit_tree, 1, (const git_commit**)&head_commit)); + + cl_git_mkfile("renames/copy.txt", "Hello World!\n"); + cl_git_rmfile("renames/small.txt"); + + diff_options.flags = GIT_DIFF_INCLUDE_UNTRACKED; + cl_git_pass(git_diff_tree_to_workdir(&diff, g_repo, commit_tree, &diff_options)); + find_options.flags = GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_FOR_UNTRACKED; + cl_git_pass(git_diff_find_similar(diff, &find_options)); + + cl_assert_equal_i(git_diff_num_deltas(diff), 1); + delta = git_diff_get_delta(diff, 0); + cl_assert_equal_i(delta->status, GIT_DELTA_RENAMED); + cl_assert_equal_s(delta->old_file.path, "small.txt"); + cl_assert_equal_s(delta->new_file.path, "copy.txt"); + + git_diff_free(diff); + git_signature_free(signature); + git_tree_free(commit_tree); + git_tree_free(head_tree); + git_commit_free(head_commit); + git_reference_free(head_reference); git_index_free(index); } @@ -453,7 +469,7 @@ /* git diff --no-renames 2bc7f351d20b53f1c72c16c4b036e491c478c49a */ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -466,7 +482,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_RENAMED]); @@ -492,7 +508,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_RENAMED]); @@ -511,7 +527,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); @@ -529,7 +545,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -559,7 +575,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -657,7 +673,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -666,7 +682,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_RENAMED]); @@ -709,7 +725,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(3, exp.file_status[GIT_DELTA_MODIFIED]); @@ -718,7 +734,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(3, exp.file_status[GIT_DELTA_RENAMED]); @@ -760,7 +776,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -769,7 +785,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_ADDED]); @@ -817,7 +833,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(4, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -827,7 +843,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_COPIED]); cl_assert_equal_i(4, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -869,7 +885,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -880,7 +896,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); @@ -945,7 +961,7 @@ cl_git_pass(git_reference_lookup(&head, g_repo, "HEAD")); cl_git_pass(git_reference_symbolic_set_target( - &selfsimilar, head, "refs/heads/renames_similar", NULL, NULL)); + &selfsimilar, head, "refs/heads/renames_similar", NULL)); cl_git_pass(git_checkout_head(g_repo, &opts)); cl_git_pass(git_repository_index(&index, g_repo)); @@ -982,8 +998,8 @@ cl_git_pass(git_diff_find_similar(diff, &findopts)); - cl_git_pass( - git_diff_foreach(diff, test_names_expected, NULL, NULL, &expect)); + cl_git_pass(git_diff_foreach( + diff, test_names_expected, NULL, NULL, NULL, &expect)); git_diff_free(diff); git_tree_free(tree); @@ -1030,7 +1046,7 @@ cl_git_pass(git_reference_lookup(&head, g_repo, "HEAD")); cl_git_pass(git_reference_symbolic_set_target( - &selfsimilar, head, "refs/heads/renames_similar_two", NULL, NULL)); + &selfsimilar, head, "refs/heads/renames_similar_two", NULL)); cl_git_pass(git_checkout_head(g_repo, &opts)); cl_git_pass(git_repository_index(&index, g_repo)); @@ -1056,8 +1072,8 @@ cl_git_pass(git_diff_find_similar(diff, &findopts)); - cl_git_pass( - git_diff_foreach(diff, test_names_expected, NULL, NULL, &expect)); + cl_git_pass(git_diff_foreach( + diff, test_names_expected, NULL, NULL, NULL, &expect)); cl_assert(expect.idx > 0); git_diff_free(diff); @@ -1088,7 +1104,7 @@ cl_git_pass(git_reference_lookup(&head, g_repo, "HEAD")); cl_git_pass(git_reference_symbolic_set_target( - &selfsimilar, head, "refs/heads/renames_similar_two", NULL, NULL)); + &selfsimilar, head, "refs/heads/renames_similar_two", NULL)); cl_git_pass(git_checkout_head(g_repo, &opts)); cl_git_pass(git_repository_index(&index, g_repo)); @@ -1112,8 +1128,8 @@ cl_git_pass(git_diff_find_similar(diff, &findopts)); - cl_git_pass( - git_diff_foreach(diff, test_names_expected, NULL, NULL, &expect)); + cl_git_pass(git_diff_foreach( + diff, test_names_expected, NULL, NULL, NULL, &expect)); cl_assert(expect.idx == expect.len); @@ -1161,8 +1177,8 @@ cl_git_pass(git_diff_find_similar(diff, &findopts)); - cl_git_pass( - git_diff_foreach(diff, test_names_expected, NULL, NULL, &expect)); + cl_git_pass(git_diff_foreach( + diff, test_names_expected, NULL, NULL, NULL, &expect)); cl_assert(expect.idx == expect.len); @@ -1194,7 +1210,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_ADDED]); @@ -1204,7 +1220,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); @@ -1236,7 +1252,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_ADDED]); @@ -1246,13 +1262,13 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); @@ -1301,7 +1317,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNTRACKED]); @@ -1336,7 +1352,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); cl_assert_equal_i(3, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -1346,7 +1362,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_COPIED]); @@ -1385,7 +1401,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); cl_assert_equal_i(3, exp.file_status[GIT_DELTA_UNMODIFIED]); @@ -1395,7 +1411,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_COPIED]); @@ -1435,7 +1451,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, &opts)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); @@ -1449,7 +1465,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, &opts)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_ADDED]); @@ -1463,7 +1479,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, &opts)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -1476,7 +1492,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, NULL)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -1519,7 +1535,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, &opts)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -1533,7 +1549,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, &opts)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNMODIFIED]); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); @@ -1574,7 +1590,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_find_similar(diff, &opts)); cl_git_pass(git_diff_foreach(diff, - diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(5, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); @@ -1586,3 +1602,103 @@ git_tree_free(tree1); git_tree_free(tree2); } + +static void expect_files_renamed(const char *one, const char *two, uint32_t whitespace_flags) +{ + git_index *index; + git_diff *diff = NULL; + diff_expects exp; + git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; + git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT; + + diffopts.flags = GIT_DIFF_INCLUDE_UNTRACKED; + findopts.flags = GIT_DIFF_FIND_FOR_UNTRACKED | + GIT_DIFF_FIND_AND_BREAK_REWRITES | + GIT_DIFF_FIND_RENAMES_FROM_REWRITES | + whitespace_flags; + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_rewritefile("renames/ikeepsix.txt", one); + cl_git_pass(git_index_add_bypath(index, "ikeepsix.txt")); + + cl_git_rmfile("renames/ikeepsix.txt"); + cl_git_rewritefile("renames/ikeepsix2.txt", two); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, &diffopts)); + cl_git_pass(git_diff_find_similar(diff, &findopts)); + + memset(&exp, 0, sizeof(exp)); + + cl_git_pass(git_diff_foreach( + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); + cl_assert_equal_i(1, exp.files); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); + + git_diff_free(diff); + git_index_free(index); +} + +/* test some variations on empty and blank files */ +void test_diff_rename__empty_files_renamed(void) +{ + /* empty files are identical when ignoring whitespace or not */ + expect_files_renamed("", "", GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE); + expect_files_renamed("", "", GIT_DIFF_FIND_IGNORE_WHITESPACE); +} + +/* test that blank files are similar when ignoring whitespace */ +void test_diff_rename__blank_files_renamed_when_ignoring_whitespace(void) +{ + expect_files_renamed("", "\n\n", GIT_DIFF_FIND_IGNORE_WHITESPACE); + expect_files_renamed("", "\r\n\r\n", GIT_DIFF_FIND_IGNORE_WHITESPACE); + expect_files_renamed("\r\n\r\n", "\n\n\n", GIT_DIFF_FIND_IGNORE_WHITESPACE); + + expect_files_renamed(" ", "\n\n", GIT_DIFF_FIND_IGNORE_WHITESPACE); + expect_files_renamed(" \n \n", "\n\n", GIT_DIFF_FIND_IGNORE_WHITESPACE); +} + +/* blank files are not similar when whitespace is not ignored */ +static void expect_files_not_renamed(const char *one, const char *two, uint32_t whitespace_flags) +{ + git_index *index; + git_diff *diff = NULL; + diff_expects exp; + git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; + git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT; + + diffopts.flags = GIT_DIFF_INCLUDE_UNTRACKED; + + findopts.flags = GIT_DIFF_FIND_FOR_UNTRACKED | + whitespace_flags; + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_rewritefile("renames/ikeepsix.txt", one); + cl_git_pass(git_index_add_bypath(index, "ikeepsix.txt")); + + cl_git_rmfile("renames/ikeepsix.txt"); + cl_git_rewritefile("renames/ikeepsix2.txt", two); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, &diffopts)); + cl_git_pass(git_diff_find_similar(diff, &findopts)); + + memset(&exp, 0, sizeof(exp)); + + cl_git_pass(git_diff_foreach( + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); + cl_assert_equal_i(2, exp.files); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNTRACKED]); + + git_diff_free(diff); + git_index_free(index); +} + +/* test that blank files are similar when ignoring renames */ +void test_diff_rename__blank_files_not_renamed_when_not_ignoring_whitespace(void) +{ + expect_files_not_renamed("", "\r\n\r\n\r\n", GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE); + expect_files_not_renamed("", "\n\n\n\n", GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE); + expect_files_not_renamed("\n\n\n\n", "\r\n\r\n\r\n", GIT_DIFF_FIND_DONT_IGNORE_WHITESPACE); +} diff -Nru libgit2-0.22.2/tests/diff/submodules.c libgit2-0.23.1/tests/diff/submodules.c --- libgit2-0.22.2/tests/diff/submodules.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/submodules.c 2015-08-03 18:07:35.000000000 +0000 @@ -273,13 +273,13 @@ /* create untracked file in submodule working directory */ cl_git_mkfile("submod2/sm_changed_head/new_around_here", "hello"); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_NONE); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_NONE); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_dirty); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_UNTRACKED); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_UNTRACKED); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); @@ -301,7 +301,7 @@ check_diff_patches(diff, expected_dirty); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_DIRTY); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_DIRTY); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); @@ -312,13 +312,13 @@ cl_git_pass(git_repository_index(&smindex, smrepo)); cl_git_pass(git_index_add_bypath(smindex, "file_to_modify")); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_UNTRACKED); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_UNTRACKED); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_dirty); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_DIRTY); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_DIRTY); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); @@ -327,19 +327,19 @@ /* commit changed index of submodule */ cl_repo_commit_from_index(NULL, smrepo, NULL, 1372350000, "Move it"); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_DIRTY); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_DIRTY); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_moved); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_ALL); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_ALL); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_unchanged); git_diff_free(diff); - git_submodule_set_ignore(sm, GIT_SUBMODULE_IGNORE_NONE); + git_submodule_set_ignore(g_repo, git_submodule_name(sm), GIT_SUBMODULE_IGNORE_NONE); cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); check_diff_patches(diff, expected_moved_dirty); @@ -465,7 +465,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); git_diff_free(diff); @@ -478,7 +478,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_IGNORED]); git_diff_free(diff); @@ -488,7 +488,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_UNTRACKED]); git_diff_free(diff); diff -Nru libgit2-0.22.2/tests/diff/tree.c libgit2-0.23.1/tests/diff/tree.c --- libgit2-0.22.2/tests/diff/tree.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/tree.c 2015-08-03 18:07:35.000000000 +0000 @@ -49,7 +49,7 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(5, expect.files); cl_assert_equal_i(2, expect.file_status[GIT_DELTA_ADDED]); @@ -71,7 +71,7 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, c, b, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(2, expect.files); cl_assert_equal_i(0, expect.file_status[GIT_DELTA_ADDED]); @@ -89,7 +89,7 @@ } #define DIFF_OPTS(FLAGS, CTXT) \ - {GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_DEFAULT, \ + {GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_UNSPECIFIED, \ {NULL,0}, NULL, NULL, (CTXT), 1} void test_diff_tree__options(void) @@ -158,7 +158,7 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, c, d, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &actual)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &actual)); expected = &test_expects[i]; cl_assert_equal_i(actual.files, expected->files); @@ -194,7 +194,7 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(3, expect.files); cl_assert_equal_i(2, expect.file_status[GIT_DELTA_ADDED]); @@ -235,7 +235,7 @@ git_diff_free(diff2); cl_git_pass(git_diff_foreach( - diff1, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + diff1, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(6, expect.files); cl_assert_equal_i(2, expect.file_status[GIT_DELTA_ADDED]); @@ -332,7 +332,7 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, NULL, NULL, &expect)); + diff, diff_file_cb, NULL, NULL, NULL, &expect)); } void test_diff_tree__symlink_blob_mode_changed_to_regular_file(void) @@ -441,8 +441,8 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, &opts)); - cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + cl_git_pass(git_diff_foreach(diff, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(1, expect.files); cl_assert_equal_i(0, expect.file_status[GIT_DELTA_DELETED]); @@ -472,8 +472,8 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, NULL)); - cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + cl_git_pass(git_diff_foreach(diff, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(2, expect.files); cl_assert_equal_i(2, expect.file_status[GIT_DELTA_MODIFIED]); @@ -492,8 +492,8 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, NULL)); - cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + cl_git_pass(git_diff_foreach(diff, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(2, expect.files); cl_assert_equal_i(2, expect.file_status[GIT_DELTA_MODIFIED]); @@ -513,8 +513,8 @@ cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, NULL)); - cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &expect)); + cl_git_pass(git_diff_foreach(diff, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect)); cl_assert_equal_i(2, expect.files); cl_assert_equal_i(2, expect.file_status[GIT_DELTA_MODIFIED]); diff -Nru libgit2-0.22.2/tests/diff/workdir.c libgit2-0.23.1/tests/diff/workdir.c --- libgit2-0.22.2/tests/diff/workdir.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/diff/workdir.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,6 +2,7 @@ #include "diff_helpers.h" #include "repository.h" #include "git2/sys/diff.h" +#include "../checkout/checkout_helpers.h" static git_repository *g_repo = NULL; @@ -30,10 +31,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); /* to generate these values: * - cd to tests/resources/status, @@ -68,6 +69,51 @@ git_diff_free(diff); } +void test_diff_workdir__to_index_with_conflicts(void) +{ + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff = NULL; + git_index *index; + git_index_entry our_entry = {{0}}, their_entry = {{0}}; + diff_expects exp = {0}; + + g_repo = cl_git_sandbox_init("status"); + + opts.context_lines = 3; + opts.interhunk_lines = 1; + + /* Adding an entry that represents a rename gets two files in conflict */ + our_entry.path = "subdir/modified_file"; + our_entry.mode = 0100644; + + their_entry.path = "subdir/rename_conflict"; + their_entry.mode = 0100644; + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_conflict_add(index, NULL, &our_entry, &their_entry)); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, &opts)); + + cl_git_pass(diff_foreach_via_iterator( + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); + + cl_assert_equal_i(9, exp.files); + cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); + cl_assert_equal_i(4, exp.file_status[GIT_DELTA_DELETED]); + cl_assert_equal_i(3, exp.file_status[GIT_DELTA_MODIFIED]); + cl_assert_equal_i(2, exp.file_status[GIT_DELTA_CONFLICTED]); + + cl_assert_equal_i(7, exp.hunks); + + cl_assert_equal_i(12, exp.lines); + cl_assert_equal_i(4, exp.line_ctxt); + cl_assert_equal_i(3, exp.line_adds); + cl_assert_equal_i(5, exp.line_dels); + + git_diff_free(diff); + git_index_free(index); +} + void test_diff_workdir__to_index_with_assume_unchanged(void) { git_diff_options opts = GIT_DIFF_OPTIONS_INIT; @@ -84,7 +130,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(8, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(4, exp.file_status[GIT_DELTA_DELETED]); @@ -113,7 +159,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(6, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(3, exp.file_status[GIT_DELTA_DELETED]); @@ -160,10 +206,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(14, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -196,10 +242,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(15, exp.files); cl_assert_equal_i(2, exp.file_status[GIT_DELTA_ADDED]); @@ -233,10 +279,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(16, exp.files); cl_assert_equal_i(5, exp.file_status[GIT_DELTA_ADDED]); @@ -267,7 +313,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(16, exp.files); cl_assert_equal_i(5, exp.file_status[GIT_DELTA_DELETED]); @@ -314,9 +360,9 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); else - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(13, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -337,9 +383,9 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); else - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -360,9 +406,9 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); else - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -383,9 +429,9 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); else - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(2, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -420,10 +466,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); @@ -443,10 +489,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -476,7 +522,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); @@ -491,8 +537,8 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, NULL)); memset(&exp, 0, sizeof(exp)); - cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + cl_git_pass(git_diff_foreach(diff, + diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_MODIFIED]); @@ -535,10 +581,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff_i2t, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_i2t, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff_i2t, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_i2t, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -556,10 +602,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff_w2i, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_w2i, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff_w2i, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_w2i, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -579,10 +625,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff_i2t, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_i2t, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff_i2t, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff_i2t, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -621,10 +667,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -648,10 +694,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -675,10 +721,10 @@ if (use_iterator) cl_git_pass(diff_foreach_via_iterator( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); else cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -868,7 +914,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); /* so "git diff 873585" returns: * M .gitmodules @@ -946,7 +992,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(exp.files, exp.file_status[GIT_DELTA_UNTRACKED]); @@ -1035,7 +1081,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.hunks); @@ -1051,7 +1097,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(1, exp.files); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]); @@ -1088,7 +1134,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.hunks); @@ -1104,7 +1150,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(0, exp.files); cl_assert_equal_i(0, exp.hunks); @@ -1158,7 +1204,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(3, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1178,7 +1224,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1198,7 +1244,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1222,7 +1268,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1245,7 +1291,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1265,7 +1311,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1288,7 +1334,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1309,7 +1355,7 @@ cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); - cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, &exp)); + cl_git_pass(git_diff_foreach(diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(4, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1460,7 +1506,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(17, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1482,7 +1528,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + diff, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); git_diff_free(diff); @@ -1498,19 +1544,21 @@ static int touch_file(void *payload, git_buf *path) { - int fd; - char b; + struct stat st; + struct timeval times[2]; GIT_UNUSED(payload); if (git_path_isdir(path->ptr)) return 0; - cl_assert((fd = p_open(path->ptr, O_RDWR)) >= 0); - cl_assert_equal_i(1, p_read(fd, &b, 1)); - cl_must_pass(p_lseek(fd, 0, SEEK_SET)); - cl_must_pass(p_write(fd, &b, 1)); - cl_must_pass(p_close(fd)); + cl_must_pass(p_stat(path->ptr, &st)); + times[0].tv_sec = st.st_mtime + 3; + times[0].tv_usec = 0; + times[1].tv_sec = st.st_mtime + 3; + times[1].tv_usec = 0; + + cl_must_pass(p_utimes(path->ptr, times)); return 0; } @@ -1523,7 +1571,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - *out, diff_file_cb, diff_hunk_cb, diff_line_cb, &exp)); + *out, diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp)); cl_assert_equal_i(13, exp.files); cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]); @@ -1538,6 +1586,7 @@ git_diff_options opts = GIT_DIFF_OPTIONS_INIT; git_diff *diff = NULL; git_diff_perfdata perf = GIT_DIFF_PERFDATA_INIT; + git_index *index; g_repo = cl_git_sandbox_init("status"); @@ -1562,6 +1611,10 @@ /* now allow diff to update stat cache */ opts.flags |= GIT_DIFF_UPDATE_INDEX; + /* advance a tick for the index so we don't re-calculate racily-clean entries */ + cl_git_pass(git_repository_index__weakptr(&index, g_repo)); + tick_index(index); + basic_diff_status(&diff, &opts); cl_git_pass(git_diff_get_perfdata(&perf, diff)); @@ -1572,6 +1625,8 @@ /* now if we do it again, we should see fewer OID calculations */ + /* tick again as the index updating from the previous diff might have reset the timestamp */ + tick_index(index); basic_diff_status(&diff, &opts); cl_git_pass(git_diff_get_perfdata(&perf, diff)); @@ -1694,3 +1749,98 @@ git_index_free(idx); git_buf_free(&b); } + +void test_diff_workdir__to_index_conflicted(void) { + const char *a_commit = "26a125ee1bf"; /* the current HEAD */ + git_index_entry ancestor = {{0}}, ours = {{0}}, theirs = {{0}}; + git_tree *a; + git_index *index; + git_diff *diff1, *diff2; + const git_diff_delta *delta; + + g_repo = cl_git_sandbox_init("status"); + a = resolve_commit_oid_to_tree(g_repo, a_commit); + + cl_git_pass(git_repository_index(&index, g_repo)); + + ancestor.path = ours.path = theirs.path = "_file"; + ancestor.mode = ours.mode = theirs.mode = 0100644; + git_oid_fromstr(&ancestor.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&ours.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + git_oid_fromstr(&theirs.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs)); + + cl_git_pass(git_diff_tree_to_index(&diff1, g_repo, a, index, NULL)); + cl_git_pass(git_diff_index_to_workdir(&diff2, g_repo, index, NULL)); + cl_git_pass(git_diff_merge(diff1, diff2)); + + cl_assert_equal_i(git_diff_num_deltas(diff1), 12); + delta = git_diff_get_delta(diff1, 0); + cl_assert_equal_s(delta->old_file.path, "_file"); + cl_assert_equal_i(delta->nfiles, 1); + cl_assert_equal_i(delta->status, GIT_DELTA_CONFLICTED); + + git_diff_free(diff2); + git_diff_free(diff1); + git_index_free(index); + git_tree_free(a); +} + +void test_diff_workdir__only_writes_index_when_necessary(void) +{ + git_index *index; + git_diff_options opts = GIT_DIFF_OPTIONS_INIT; + git_diff *diff = NULL; + git_reference *head; + git_object *head_object; + git_oid initial, first, second; + git_buf path = GIT_BUF_INIT; + struct stat st; + struct timeval times[2]; + + opts.flags |= GIT_DIFF_INCLUDE_UNTRACKED | GIT_DIFF_UPDATE_INDEX; + + g_repo = cl_git_sandbox_init("status"); + + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_repository_head(&head, g_repo)); + cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT)); + + cl_git_pass(git_reset(g_repo, head_object, GIT_RESET_HARD, NULL)); + + git_oid_cpy(&initial, git_index_checksum(index)); + + /* update the index timestamp to avoid raciness */ + cl_must_pass(p_stat("status/.git/index", &st)); + + times[0].tv_sec = st.st_mtime + 5; + times[0].tv_usec = 0; + times[1].tv_sec = st.st_mtime + 5; + times[1].tv_usec = 0; + + cl_must_pass(p_utimes("status/.git/index", times)); + + /* ensure diff doesn't touch the index */ + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + git_diff_free(diff); + + git_oid_cpy(&first, git_index_checksum(index)); + cl_assert(!git_oid_equal(&initial, &first)); + + /* touch all the files so stat times are different */ + cl_git_pass(git_buf_sets(&path, "status")); + cl_git_pass(git_path_direach(&path, 0, touch_file, NULL)); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, &opts)); + git_diff_free(diff); + + /* ensure the second diff did update the index */ + git_oid_cpy(&second, git_index_checksum(index)); + cl_assert(!git_oid_equal(&first, &second)); + + git_buf_free(&path); + git_object_free(head_object); + git_reference_free(head); + git_index_free(index); +} + diff -Nru libgit2-0.22.2/tests/fetchhead/nonetwork.c libgit2-0.23.1/tests/fetchhead/nonetwork.c --- libgit2-0.22.2/tests/fetchhead/nonetwork.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/fetchhead/nonetwork.c 2015-08-03 18:07:35.000000000 +0000 @@ -331,9 +331,8 @@ cl_git_pass(git_clone(&repo, "./test1", "./repowithunborn", NULL)); /* Simulate someone pushing to it by changing to one that has stuff */ + cl_git_pass(git_remote_set_url(repo, "origin", cl_fixture("testrepo.git"))); cl_git_pass(git_remote_lookup(&remote, repo, "origin")); - cl_git_pass(git_remote_set_url(remote, cl_fixture("testrepo.git"))); - cl_git_pass(git_remote_save(remote)); cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); git_remote_free(remote); @@ -352,3 +351,50 @@ cl_git_rewritefile("./test1/.git/FETCH_HEAD", FETCH_HEAD_QUOTE_DATA); cl_git_pass(git_repository_fetchhead_foreach(g_repo, read_noop, NULL)); } + +static bool found_master; +static bool find_master_called; + +int find_master(const char *ref_name, const char *remote_url, const git_oid *oid, unsigned int is_merge, void *payload) +{ + GIT_UNUSED(remote_url); + GIT_UNUSED(oid); + GIT_UNUSED(payload); + + find_master_called = true; + + if (!strcmp("refs/heads/master", ref_name)) { + cl_assert(is_merge); + found_master = true; + } + + return 0; +} + +void test_fetchhead_nonetwork__create_when_refpecs_given(void) +{ + git_remote *remote; + git_buf path = GIT_BUF_INIT; + char *refspec = "refs/heads/master"; + git_strarray specs = { + &refspec, + 1, + }; + + cl_set_cleanup(&cleanup_repository, "./test1"); + cl_git_pass(git_repository_init(&g_repo, "./test1", 0)); + + cl_git_pass(git_buf_joinpath(&path, git_repository_path(g_repo), "FETCH_HEAD")); + cl_git_pass(git_remote_create(&remote, g_repo, "origin", cl_fixture("testrepo.git"))); + + cl_assert(!git_path_exists(path.ptr)); + cl_git_pass(git_remote_fetch(remote, &specs, NULL, NULL)); + cl_assert(git_path_exists(path.ptr)); + + cl_git_pass(git_repository_fetchhead_foreach(g_repo, find_master, NULL)); + cl_assert(find_master_called); + cl_assert(found_master); + + git_remote_free(remote); + git_buf_free(&path); +} diff -Nru libgit2-0.22.2/tests/filter/blob.c libgit2-0.23.1/tests/filter/blob.c --- libgit2-0.22.2/tests/filter/blob.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/filter/blob.c 2015-08-03 18:07:35.000000000 +0000 @@ -105,11 +105,11 @@ cl_git_pass(git_blob_filtered_content(&buf, blob, "filter.identcrlf", 1)); cl_assert_equal_s( - "Some text\r\n$Id: 3164f585d548ac68027d22b104f2d8100b2b6845$\r\nGoes there\r\n", buf.ptr); + "Some text\r\n$Id: 3164f585d548ac68027d22b104f2d8100b2b6845 $\r\nGoes there\r\n", buf.ptr); cl_git_pass(git_blob_filtered_content(&buf, blob, "filter.identlf", 1)); cl_assert_equal_s( - "Some text\n$Id: 3164f585d548ac68027d22b104f2d8100b2b6845$\nGoes there\n", buf.ptr); + "Some text\n$Id: 3164f585d548ac68027d22b104f2d8100b2b6845 $\nGoes there\n", buf.ptr); git_buf_free(&buf); git_blob_free(blob); diff -Nru libgit2-0.22.2/tests/filter/crlf.c libgit2-0.23.1/tests/filter/crlf.c --- libgit2-0.22.2/tests/filter/crlf.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/filter/crlf.c 2015-08-03 18:07:35.000000000 +0000 @@ -38,11 +38,7 @@ cl_git_pass(git_filter_list_apply_to_data(&out, fl, &in)); -#ifdef GIT_WIN32 cl_assert_equal_s("Some text\r\nRight here\r\n", out.ptr); -#else - cl_assert_equal_s("Some text\nRight here\n", out.ptr); -#endif git_filter_list_free(fl); git_buf_free(&out); @@ -123,7 +119,7 @@ cl_repo_set_bool(g_repo, "core.safecrlf", true); cl_git_pass(git_filter_list_new( - &fl, g_repo, GIT_FILTER_TO_ODB, GIT_FILTER_OPT_ALLOW_UNSAFE)); + &fl, g_repo, GIT_FILTER_TO_ODB, GIT_FILTER_ALLOW_UNSAFE)); crlf = git_filter_lookup(GIT_FILTER_CRLF); cl_assert(crlf != NULL); diff -Nru libgit2-0.22.2/tests/filter/crlf.h libgit2-0.23.1/tests/filter/crlf.h --- libgit2-0.22.2/tests/filter/crlf.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/filter/crlf.h 2015-08-03 18:07:35.000000000 +0000 @@ -22,4 +22,9 @@ #define MORE_CRLF_TEXT_AS_LF "crlf\ncrlf\nlf\ncrlf\ncrlf\n" #define MORE_LF_TEXT_AS_LF "lf\nlf\ncrlf\nlf\nlf\n" +#define FEW_UTF8_CRLF_RAW "\xe2\x9a\xbdThe rest is ASCII01.\r\nThe rest is ASCII02.\r\nThe rest is ASCII03.\r\nThe rest is ASCII04.\r\nThe rest is ASCII05.\r\nThe rest is ASCII06.\r\nThe rest is ASCII07.\r\nThe rest is ASCII08.\r\nThe rest is ASCII09.\r\nThe rest is ASCII10.\r\nThe rest is ASCII11.\r\nThe rest is ASCII12.\r\nThe rest is ASCII13.\r\nThe rest is ASCII14.\r\nThe rest is ASCII15.\r\nThe rest is ASCII16.\r\nThe rest is ASCII17.\r\nThe rest is ASCII18.\r\nThe rest is ASCII19.\r\nThe rest is ASCII20.\r\nThe rest is ASCII21.\r\nThe rest is ASCII22.\r\n" +#define FEW_UTF8_LF_RAW "\xe2\x9a\xbdThe rest is ASCII01.\nThe rest is ASCII02.\nThe rest is ASCII03.\nThe rest is ASCII04.\nThe rest is ASCII05.\nThe rest is ASCII06.\nThe rest is ASCII07.\nThe rest is ASCII08.\nThe rest is ASCII09.\nThe rest is ASCII10.\nThe rest is ASCII11.\nThe rest is ASCII12.\nThe rest is ASCII13.\nThe rest is ASCII14.\nThe rest is ASCII15.\nThe rest is ASCII16.\nThe rest is ASCII17.\nThe rest is ASCII18.\nThe rest is ASCII19.\nThe rest is ASCII20.\nThe rest is ASCII21.\nThe rest is ASCII22.\n" +#define MANY_UTF8_CRLF_RAW "Lets sing!\r\n\xe2\x99\xab\xe2\x99\xaa\xe2\x99\xac\xe2\x99\xa9\r\nEat food\r\n\xf0\x9f\x8d\x85\xf0\x9f\x8d\x95\r\n" +#define MANY_UTF8_LF_RAW "Lets sing!\n\xe2\x99\xab\xe2\x99\xaa\xe2\x99\xac\xe2\x99\xa9\nEat food\n\xf0\x9f\x8d\x85\xf0\x9f\x8d\x95\n" + #endif diff -Nru libgit2-0.22.2/tests/filter/custom.c libgit2-0.23.1/tests/filter/custom.c --- libgit2-0.22.2/tests/filter/custom.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/filter/custom.c 2015-08-03 18:07:35.000000000 +0000 @@ -318,7 +318,7 @@ /* expansion because reverse was applied at checkin and at ident time, * reverse is not applied yet */ cl_assert_equal_s( - "Another test\n$59001fe193103b1016b27027c0c827d036fd0ac8 :dI$\nCrazy!\n", buf.ptr); + "Another test\n$ 59001fe193103b1016b27027c0c827d036fd0ac8 :dI$\nCrazy!\n", buf.ptr); cl_assert_equal_i(0, git_oid_strcmp( git_blob_id(blob), "8ca0df630d728c0c72072b6101b301391ef10095")); git_blob_free(blob); diff -Nru libgit2-0.22.2/tests/filter/file.c libgit2-0.23.1/tests/filter/file.c --- libgit2-0.22.2/tests/filter/file.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/filter/file.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,99 @@ +#include "clar_libgit2.h" +#include "git2/sys/filter.h" +#include "crlf.h" +#include "buffer.h" + +static git_repository *g_repo = NULL; + +void test_filter_file__initialize(void) +{ + git_reference *head_ref; + git_commit *head; + + g_repo = cl_git_sandbox_init("crlf"); + + cl_git_mkfile("crlf/.gitattributes", + "*.txt text\n*.bin binary\n*.crlf text eol=crlf\n*.lf text eol=lf\n"); + + cl_repo_set_bool(g_repo, "core.autocrlf", true); + + cl_git_pass(git_repository_head(&head_ref, g_repo)); + cl_git_pass(git_reference_peel((git_object **)&head, head_ref, GIT_OBJ_COMMIT)); + cl_git_pass(git_reset(g_repo, (git_object *)head, GIT_RESET_HARD, NULL)); + + git_commit_free(head); + git_reference_free(head_ref); +} + +void test_filter_file__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_filter_file__apply(void) +{ + git_filter_list *fl; + git_filter *crlf; + git_buf buf = GIT_BUF_INIT; + + cl_git_pass(git_filter_list_new( + &fl, g_repo, GIT_FILTER_TO_ODB, 0)); + + crlf = git_filter_lookup(GIT_FILTER_CRLF); + cl_assert(crlf != NULL); + + cl_git_pass(git_filter_list_push(fl, crlf, NULL)); + + cl_git_pass(git_filter_list_apply_to_file(&buf, fl, g_repo, "all-crlf")); + cl_assert_equal_s("crlf\ncrlf\ncrlf\ncrlf\n", buf.ptr); + + git_buf_free(&buf); + git_filter_list_free(fl); +} + +struct buf_writestream { + git_writestream base; + git_buf buf; +}; + +int buf_writestream_write(git_writestream *s, const char *buf, size_t len) +{ + struct buf_writestream *stream = (struct buf_writestream *)s; + return git_buf_put(&stream->buf, buf, len); +} + +int buf_writestream_close(git_writestream *s) +{ + GIT_UNUSED(s); + return 0; +} + +void buf_writestream_free(git_writestream *s) +{ + struct buf_writestream *stream = (struct buf_writestream *)s; + git_buf_free(&stream->buf); +} + +void test_filter_file__apply_stream(void) +{ + git_filter_list *fl; + git_filter *crlf; + struct buf_writestream write_target = { { + buf_writestream_write, + buf_writestream_close, + buf_writestream_free } }; + + cl_git_pass(git_filter_list_new( + &fl, g_repo, GIT_FILTER_TO_ODB, 0)); + + crlf = git_filter_lookup(GIT_FILTER_CRLF); + cl_assert(crlf != NULL); + + cl_git_pass(git_filter_list_push(fl, crlf, NULL)); + + cl_git_pass(git_filter_list_stream_file(fl, g_repo, "all-crlf", &write_target.base)); + cl_assert_equal_s("crlf\ncrlf\ncrlf\ncrlf\n", write_target.buf.ptr); + + git_filter_list_free(fl); + write_target.base.free(&write_target.base); +} diff -Nru libgit2-0.22.2/tests/filter/ident.c libgit2-0.23.1/tests/filter/ident.c --- libgit2-0.22.2/tests/filter/ident.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/filter/ident.c 2015-08-03 18:07:35.000000000 +0000 @@ -49,22 +49,22 @@ add_blob_and_filter( "Hello\n$Id$\nFun stuff\n", fl, - "Hello\n$Id: b69e2387aafcaf73c4de5b9ab59abe27fdadee30$\nFun stuff\n"); + "Hello\n$Id: b69e2387aafcaf73c4de5b9ab59abe27fdadee30 $\nFun stuff\n"); add_blob_and_filter( "Hello\n$Id: Junky$\nFun stuff\n", fl, - "Hello\n$Id: 45cd107a7102911cb2a7df08404674327fa050b9$\nFun stuff\n"); + "Hello\n$Id: 45cd107a7102911cb2a7df08404674327fa050b9 $\nFun stuff\n"); add_blob_and_filter( "$Id$\nAt the start\n", fl, - "$Id: b13415c767abc196fb95bd17070e8c1113e32160$\nAt the start\n"); + "$Id: b13415c767abc196fb95bd17070e8c1113e32160 $\nAt the start\n"); add_blob_and_filter( "At the end\n$Id$", fl, - "At the end\n$Id: 1344925c6bc65b34c5a7b50f86bf688e48e9a272$"); + "At the end\n$Id: 1344925c6bc65b34c5a7b50f86bf688e48e9a272 $"); add_blob_and_filter( "$Id$", fl, - "$Id: b3f5ebfb5843bc43ceecff6d4f26bb37c615beb1$"); + "$Id: b3f5ebfb5843bc43ceecff6d4f26bb37c615beb1 $"); add_blob_and_filter( "$Id: Some sort of junk goes here$", fl, - "$Id: ab2dd3853c7c9a4bff55aca2bea077a73c32ac06$"); + "$Id: ab2dd3853c7c9a4bff55aca2bea077a73c32ac06 $"); add_blob_and_filter("$Id: ", fl, "$Id: "); add_blob_and_filter("$Id", fl, "$Id"); diff -Nru libgit2-0.22.2/tests/filter/query.c libgit2-0.23.1/tests/filter/query.c --- libgit2-0.22.2/tests/filter/query.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/filter/query.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,91 @@ +#include "clar_libgit2.h" +#include "git2/sys/filter.h" +#include "crlf.h" +#include "buffer.h" + +static git_repository *g_repo = NULL; + +void test_filter_query__initialize(void) +{ + g_repo = cl_git_sandbox_init("crlf"); + + cl_git_mkfile("crlf/.gitattributes", + "*.txt text\n" + "*.bin binary\n" + "*.crlf text eol=crlf\n" + "*.lf text eol=lf\n" + "*.binident binary ident\n" + "*.ident text ident\n" + "*.identcrlf ident text eol=crlf\n" + "*.identlf ident text eol=lf\n" + "*.custom custom ident text\n"); +} + +void test_filter_query__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +static int filter_for(const char *filename, const char *filter) +{ + git_filter_list *fl; + int filtered; + + cl_git_pass(git_filter_list_load( + &fl, g_repo, NULL, filename, GIT_FILTER_TO_WORKTREE, 0)); + filtered = git_filter_list_contains(fl, filter); + git_filter_list_free(fl); + + return filtered; +} + +void test_filter_query__filters(void) +{ + cl_assert_equal_i(1, filter_for("text.txt", "crlf")); + cl_assert_equal_i(0, filter_for("binary.bin", "crlf")); + + cl_assert_equal_i(1, filter_for("foo.lf", "crlf")); + cl_assert_equal_i(0, filter_for("foo.lf", "ident")); + + cl_assert_equal_i(1, filter_for("id.ident", "crlf")); + cl_assert_equal_i(1, filter_for("id.ident", "ident")); + + cl_assert_equal_i(0, filter_for("id.binident", "crlf")); + cl_assert_equal_i(1, filter_for("id.binident", "ident")); +} + +void test_filter_query__autocrlf_true_implies_crlf(void) +{ + cl_repo_set_bool(g_repo, "core.autocrlf", true); + cl_assert_equal_i(1, filter_for("not_in_gitattributes", "crlf")); + cl_assert_equal_i(1, filter_for("foo.txt", "crlf")); + cl_assert_equal_i(0, filter_for("foo.bin", "crlf")); + cl_assert_equal_i(1, filter_for("foo.lf", "crlf")); + + cl_repo_set_bool(g_repo, "core.autocrlf", false); + cl_assert_equal_i(0, filter_for("not_in_gitattributes", "crlf")); + cl_assert_equal_i(1, filter_for("foo.txt", "crlf")); + cl_assert_equal_i(0, filter_for("foo.bin", "crlf")); + cl_assert_equal_i(1, filter_for("foo.lf", "crlf")); +} + +void test_filter_query__unknown(void) +{ + cl_assert_equal_i(1, filter_for("foo.custom", "crlf")); + cl_assert_equal_i(1, filter_for("foo.custom", "ident")); + cl_assert_equal_i(0, filter_for("foo.custom", "custom")); +} + +void test_filter_query__custom(void) +{ + git_filter custom = { GIT_FILTER_VERSION }; + + cl_git_pass(git_filter_register( + "custom", &custom, 42)); + + cl_assert_equal_i(1, filter_for("foo.custom", "crlf")); + cl_assert_equal_i(1, filter_for("foo.custom", "ident")); + cl_assert_equal_i(1, filter_for("foo.custom", "custom")); + + git_filter_unregister("custom"); +} diff -Nru libgit2-0.22.2/tests/filter/stream.c libgit2-0.23.1/tests/filter/stream.c --- libgit2-0.22.2/tests/filter/stream.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/filter/stream.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,216 @@ +#include "clar_libgit2.h" +#include "posix.h" +#include "blob.h" +#include "filter.h" +#include "buf_text.h" +#include "git2/sys/filter.h" +#include "git2/sys/repository.h" + +static git_repository *g_repo = NULL; + +static git_filter *create_compress_filter(void); +static git_filter *compress_filter; + +void test_filter_stream__initialize(void) +{ + compress_filter = create_compress_filter(); + + cl_git_pass(git_filter_register("compress", compress_filter, 50)); + g_repo = cl_git_sandbox_init("empty_standard_repo"); +} + +void test_filter_stream__cleanup(void) +{ + cl_git_sandbox_cleanup(); + g_repo = NULL; + + git_filter_unregister("compress"); + git__free(compress_filter); +} + +#define CHUNKSIZE 10240 + +struct compress_stream { + git_writestream parent; + git_writestream *next; + git_filter_mode_t mode; + char current; + size_t current_chunk; +}; + +static int compress_stream_write__deflated(struct compress_stream *stream, const char *buffer, size_t len) +{ + size_t idx = 0; + + while (len > 0) { + size_t chunkremain, chunksize; + + if (stream->current_chunk == 0) + stream->current = buffer[idx]; + + chunkremain = CHUNKSIZE - stream->current_chunk; + chunksize = min(chunkremain, len); + + stream->current_chunk += chunksize; + len -= chunksize; + idx += chunksize; + + if (stream->current_chunk == CHUNKSIZE) { + cl_git_pass(stream->next->write(stream->next, &stream->current, 1)); + stream->current_chunk = 0; + } + } + + return 0; +} + +static int compress_stream_write__inflated(struct compress_stream *stream, const char *buffer, size_t len) +{ + char inflated[CHUNKSIZE]; + size_t i, j; + + for (i = 0; i < len; i++) { + for (j = 0; j < CHUNKSIZE; j++) + inflated[j] = buffer[i]; + + cl_git_pass(stream->next->write(stream->next, inflated, CHUNKSIZE)); + } + + return 0; +} + +static int compress_stream_write(git_writestream *s, const char *buffer, size_t len) +{ + struct compress_stream *stream = (struct compress_stream *)s; + + return (stream->mode == GIT_FILTER_TO_ODB) ? + compress_stream_write__deflated(stream, buffer, len) : + compress_stream_write__inflated(stream, buffer, len); +} + +static int compress_stream_close(git_writestream *s) +{ + struct compress_stream *stream = (struct compress_stream *)s; + cl_assert_equal_i(0, stream->current_chunk); + stream->next->close(stream->next); + return 0; +} + +static void compress_stream_free(git_writestream *stream) +{ + git__free(stream); +} + +static int compress_filter_stream_init( + git_writestream **out, + git_filter *self, + void **payload, + const git_filter_source *src, + git_writestream *next) +{ + struct compress_stream *stream = git__calloc(1, sizeof(struct compress_stream)); + cl_assert(stream); + + GIT_UNUSED(self); + GIT_UNUSED(payload); + + stream->parent.write = compress_stream_write; + stream->parent.close = compress_stream_close; + stream->parent.free = compress_stream_free; + stream->next = next; + stream->mode = git_filter_source_mode(src); + + *out = (git_writestream *)stream; + return 0; +} + +git_filter *create_compress_filter(void) +{ + git_filter *filter = git__calloc(1, sizeof(git_filter)); + cl_assert(filter); + + filter->version = GIT_FILTER_VERSION; + filter->attributes = "+compress"; + filter->stream = compress_filter_stream_init; + + return filter; +} + +static void writefile(const char *filename, size_t numchunks) +{ + git_buf path = GIT_BUF_INIT; + char buf[CHUNKSIZE]; + size_t i = 0, j = 0; + int fd; + + cl_git_pass(git_buf_joinpath(&path, "empty_standard_repo", filename)); + + fd = p_open(path.ptr, O_RDWR|O_CREAT, 0666); + cl_assert(fd >= 0); + + for (i = 0; i < numchunks; i++) { + for (j = 0; j < CHUNKSIZE; j++) { + buf[j] = i % 256; + } + + cl_git_pass(p_write(fd, buf, CHUNKSIZE)); + } + p_close(fd); + + git_buf_free(&path); +} + +static void test_stream(size_t numchunks) +{ + git_index *index; + const git_index_entry *entry; + git_blob *blob; + struct stat st; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + + cl_git_mkfile( + "empty_standard_repo/.gitattributes", + "* compress\n"); + + /* write a file to disk */ + writefile("streamed_file", numchunks); + + /* place it in the index */ + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_add_bypath(index, "streamed_file")); + cl_git_pass(git_index_write(index)); + + /* ensure it was appropriately compressed */ + cl_assert(entry = git_index_get_bypath(index, "streamed_file", 0)); + + cl_git_pass(git_blob_lookup(&blob, g_repo, &entry->id)); + cl_assert_equal_i(numchunks, git_blob_rawsize(blob)); + + /* check the file back out */ + cl_must_pass(p_unlink("empty_standard_repo/streamed_file")); + cl_git_pass(git_checkout_index(g_repo, index, &checkout_opts)); + + /* ensure it was decompressed */ + cl_must_pass(p_stat("empty_standard_repo/streamed_file", &st)); + cl_assert_equal_sz((numchunks * CHUNKSIZE), st.st_size); + + git_index_free(index); + git_blob_free(blob); +} + +/* write a 50KB file through the "compression" stream */ +void test_filter_stream__smallfile(void) +{ + test_stream(5); +} + +/* optionally write a 500 MB file through the compression stream */ +void test_filter_stream__bigfile(void) +{ + if (!cl_getenv("GITTEST_INVASIVE_FS_SIZE")) + cl_skip(); + + test_stream(51200); +} diff -Nru libgit2-0.22.2/tests/generate_crlf.sh libgit2-0.23.1/tests/generate_crlf.sh --- libgit2-0.22.2/tests/generate_crlf.sh 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/generate_crlf.sh 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +set -e + +if [ "$1" == "" -o "$2" == "" ]; then + echo "usage: $0 crlfrepo directory [tempdir]" + exit 1 +fi + +input=$1 +output=$2 +tempdir=$3 + +set -u + +create_repo() { + local input=$1 + local output=$2 + local tempdir=$3 + local systype=$4 + local autocrlf=$5 + local attr=$6 + + local worktree="${output}/${systype}/autocrlf_${autocrlf}" + + if [ "$attr" != "" ]; then + local attrdir=`echo $attr | sed -e "s/ /,/g" | sed -e "s/=/_/g"` + worktree="${worktree},${attrdir}" + fi + + if [ "$tempdir" = "" ]; then + local gitdir="${worktree}/.git" + else + local gitdir="${tempdir}/generate_crlf_${RANDOM}" + fi + + echo "Creating ${worktree}" + mkdir -p "${worktree}" + + git clone --no-checkout --quiet --bare "${input}/.gitted" "${gitdir}" + git --work-tree="${worktree}" --git-dir="${gitdir}" config core.autocrlf ${autocrlf} + + if [ "$attr" != "" ]; then + echo "* ${attr}" >> "${worktree}/.gitattributes" + fi + + git --work-tree="${worktree}" --git-dir="${gitdir}" checkout HEAD + + if [ "$attr" != "" ]; then + rm "${worktree}/.gitattributes" + fi + + if [ "$tempdir" != "" ]; then + rm -rf "${gitdir}" + fi +} + +if [[ `uname -s` == MINGW* ]]; then + systype="windows" +else + systype="posix" +fi + +for autocrlf in true false input; do + for attr in "" text text=auto -text crlf -crlf eol=lf eol=crlf \ + "text eol=lf" "text eol=crlf" \ + "text=auto eol=lf" "text=auto eol=crlf"; do + + create_repo "${input}" "${output}" "${tempdir}" \ + "${systype}" "${autocrlf}" "${attr}" + done +done + diff -Nru libgit2-0.22.2/tests/index/addall.c libgit2-0.23.1/tests/index/addall.c --- libgit2-0.22.2/tests/index/addall.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/addall.c 2015-08-03 18:07:35.000000000 +0000 @@ -12,10 +12,7 @@ void test_index_addall__cleanup(void) { - git_repository_free(g_repo); - g_repo = NULL; - - cl_fixture_cleanup(TEST_DIR); + cl_git_sandbox_cleanup(); } #define STATUS_INDEX_FLAGS \ @@ -36,6 +33,7 @@ size_t wt_dels; size_t wt_mods; size_t ignores; + size_t conflicts; } index_status_counts; static int index_status_cb( @@ -67,6 +65,8 @@ if (status_flags & GIT_STATUS_IGNORED) vals->ignores++; + if (status_flags & GIT_STATUS_CONFLICTED) + vals->conflicts++; return 0; } @@ -75,7 +75,7 @@ git_repository *repo, size_t index_adds, size_t index_dels, size_t index_mods, size_t wt_adds, size_t wt_dels, size_t wt_mods, size_t ignores, - const char *file, int line) + size_t conflicts, const char *file, int line) { index_status_counts vals; @@ -97,10 +97,12 @@ file,line,"wrong workdir mods", 1, "%"PRIuZ, wt_mods, vals.wt_mods); clar__assert_equal( file,line,"wrong ignores", 1, "%"PRIuZ, ignores, vals.ignores); + clar__assert_equal( + file,line,"wrong conflicts", 1, "%"PRIuZ, conflicts, vals.conflicts); } -#define check_status(R,IA,ID,IM,WA,WD,WM,IG) \ - check_status_at_line(R,IA,ID,IM,WA,WD,WM,IG,__FILE__,__LINE__) +#define check_status(R,IA,ID,IM,WA,WD,WM,IG,C) \ + check_status_at_line(R,IA,ID,IM,WA,WD,WM,IG,C,__FILE__,__LINE__) static void check_stat_data(git_index *index, const char *path, bool match) { @@ -137,21 +139,22 @@ static void addall_create_test_repo(bool check_every_step) { - cl_git_pass(git_repository_init(&g_repo, TEST_DIR, false)); + g_repo = cl_git_sandbox_init_new(TEST_DIR); + if (check_every_step) - check_status(g_repo, 0, 0, 0, 0, 0, 0, 0); + check_status(g_repo, 0, 0, 0, 0, 0, 0, 0, 0); cl_git_mkfile(TEST_DIR "/file.foo", "a file"); if (check_every_step) - check_status(g_repo, 0, 0, 0, 1, 0, 0, 0); + check_status(g_repo, 0, 0, 0, 1, 0, 0, 0, 0); cl_git_mkfile(TEST_DIR "/.gitignore", "*.foo\n"); if (check_every_step) - check_status(g_repo, 0, 0, 0, 1, 0, 0, 1); + check_status(g_repo, 0, 0, 0, 1, 0, 0, 1, 0); cl_git_mkfile(TEST_DIR "/file.bar", "another file"); if (check_every_step) - check_status(g_repo, 0, 0, 0, 2, 0, 0, 1); + check_status(g_repo, 0, 0, 0, 2, 0, 0, 1, 0); } void test_index_addall__repo_lifecycle(void) @@ -171,94 +174,107 @@ cl_git_pass(git_index_add_all(index, &paths, 0, NULL, NULL)); check_stat_data(index, TEST_DIR "/file.bar", true); - check_status(g_repo, 1, 0, 0, 1, 0, 0, 1); + check_status(g_repo, 1, 0, 0, 1, 0, 0, 1, 0); cl_git_rewritefile(TEST_DIR "/file.bar", "new content for file"); check_stat_data(index, TEST_DIR "/file.bar", false); - check_status(g_repo, 1, 0, 0, 1, 0, 1, 1); + check_status(g_repo, 1, 0, 0, 1, 0, 1, 1, 0); cl_git_mkfile(TEST_DIR "/file.zzz", "yet another one"); cl_git_mkfile(TEST_DIR "/other.zzz", "yet another one"); cl_git_mkfile(TEST_DIR "/more.zzz", "yet another one"); - check_status(g_repo, 1, 0, 0, 4, 0, 1, 1); + check_status(g_repo, 1, 0, 0, 4, 0, 1, 1, 0); cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); check_stat_data(index, TEST_DIR "/file.bar", true); - check_status(g_repo, 1, 0, 0, 4, 0, 0, 1); + check_status(g_repo, 1, 0, 0, 4, 0, 0, 1, 0); cl_git_pass(git_index_add_all(index, &paths, 0, NULL, NULL)); check_stat_data(index, TEST_DIR "/file.zzz", true); - check_status(g_repo, 2, 0, 0, 3, 0, 0, 1); + check_status(g_repo, 2, 0, 0, 3, 0, 0, 1, 0); cl_repo_commit_from_index(NULL, g_repo, NULL, 0, "first commit"); - check_status(g_repo, 0, 0, 0, 3, 0, 0, 1); + check_status(g_repo, 0, 0, 0, 3, 0, 0, 1, 0); + + if (cl_repo_get_bool(g_repo, "core.filemode")) { + cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); + cl_must_pass(p_chmod(TEST_DIR "/file.zzz", 0777)); + cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); + check_status(g_repo, 0, 0, 1, 3, 0, 0, 1, 0); + + /* go back to what we had before */ + cl_must_pass(p_chmod(TEST_DIR "/file.zzz", 0666)); + cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); + check_status(g_repo, 0, 0, 0, 3, 0, 0, 1, 0); + } + /* attempt to add an ignored file - does nothing */ strs[0] = "file.foo"; cl_git_pass(git_index_add_all(index, &paths, 0, NULL, NULL)); - check_status(g_repo, 0, 0, 0, 3, 0, 0, 1); + check_status(g_repo, 0, 0, 0, 3, 0, 0, 1, 0); /* add with check - should generate error */ error = git_index_add_all( index, &paths, GIT_INDEX_ADD_CHECK_PATHSPEC, NULL, NULL); cl_assert_equal_i(GIT_EINVALIDSPEC, error); - check_status(g_repo, 0, 0, 0, 3, 0, 0, 1); + check_status(g_repo, 0, 0, 0, 3, 0, 0, 1, 0); /* add with force - should allow */ cl_git_pass(git_index_add_all( index, &paths, GIT_INDEX_ADD_FORCE, NULL, NULL)); check_stat_data(index, TEST_DIR "/file.foo", true); - check_status(g_repo, 1, 0, 0, 3, 0, 0, 0); + check_status(g_repo, 1, 0, 0, 3, 0, 0, 0, 0); /* now it's in the index, so regular add should work */ cl_git_rewritefile(TEST_DIR "/file.foo", "new content for file"); check_stat_data(index, TEST_DIR "/file.foo", false); - check_status(g_repo, 1, 0, 0, 3, 0, 1, 0); + check_status(g_repo, 1, 0, 0, 3, 0, 1, 0, 0); cl_git_pass(git_index_add_all(index, &paths, 0, NULL, NULL)); check_stat_data(index, TEST_DIR "/file.foo", true); - check_status(g_repo, 1, 0, 0, 3, 0, 0, 0); + check_status(g_repo, 1, 0, 0, 3, 0, 0, 0, 0); cl_git_pass(git_index_add_bypath(index, "more.zzz")); check_stat_data(index, TEST_DIR "/more.zzz", true); - check_status(g_repo, 2, 0, 0, 2, 0, 0, 0); + check_status(g_repo, 2, 0, 0, 2, 0, 0, 0, 0); cl_git_rewritefile(TEST_DIR "/file.zzz", "new content for file"); - check_status(g_repo, 2, 0, 0, 2, 0, 1, 0); + check_status(g_repo, 2, 0, 0, 2, 0, 1, 0, 0); cl_git_pass(git_index_add_bypath(index, "file.zzz")); check_stat_data(index, TEST_DIR "/file.zzz", true); - check_status(g_repo, 2, 0, 1, 2, 0, 0, 0); + check_status(g_repo, 2, 0, 1, 2, 0, 0, 0, 0); strs[0] = "*.zzz"; cl_git_pass(git_index_remove_all(index, &paths, NULL, NULL)); - check_status(g_repo, 1, 1, 0, 4, 0, 0, 0); + check_status(g_repo, 1, 1, 0, 4, 0, 0, 0, 0); cl_git_pass(git_index_add_bypath(index, "file.zzz")); - check_status(g_repo, 1, 0, 1, 3, 0, 0, 0); + check_status(g_repo, 1, 0, 1, 3, 0, 0, 0, 0); cl_repo_commit_from_index(NULL, g_repo, NULL, 0, "second commit"); - check_status(g_repo, 0, 0, 0, 3, 0, 0, 0); + check_status(g_repo, 0, 0, 0, 3, 0, 0, 0, 0); cl_must_pass(p_unlink(TEST_DIR "/file.zzz")); - check_status(g_repo, 0, 0, 0, 3, 1, 0, 0); + check_status(g_repo, 0, 0, 0, 3, 1, 0, 0, 0); /* update_all should be able to remove entries */ cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); - check_status(g_repo, 0, 1, 0, 3, 0, 0, 0); + check_status(g_repo, 0, 1, 0, 3, 0, 0, 0, 0); strs[0] = "*"; cl_git_pass(git_index_add_all(index, &paths, 0, NULL, NULL)); - check_status(g_repo, 3, 1, 0, 0, 0, 0, 0); + check_status(g_repo, 3, 1, 0, 0, 0, 0, 0, 0); /* must be able to remove at any position while still updating other files */ cl_must_pass(p_unlink(TEST_DIR "/.gitignore")); cl_git_rewritefile(TEST_DIR "/file.zzz", "reconstructed file"); cl_git_rewritefile(TEST_DIR "/more.zzz", "altered file reality"); - check_status(g_repo, 3, 1, 0, 1, 1, 1, 0); + check_status(g_repo, 3, 1, 0, 1, 1, 1, 0, 0); cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); - check_status(g_repo, 2, 1, 0, 1, 0, 0, 0); + check_status(g_repo, 2, 1, 0, 1, 0, 0, 0, 0); /* this behavior actually matches 'git add -u' where "file.zzz" has * been removed from the index, so when you go to update, even though * it exists in the HEAD, it is not re-added to the index, leaving it @@ -269,6 +285,28 @@ git_index_free(index); } +void test_index_addall__files_in_folders(void) +{ + git_index *index; + + addall_create_test_repo(true); + + cl_git_pass(git_repository_index(&index, g_repo)); + + cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); + check_stat_data(index, TEST_DIR "/file.bar", true); + check_status(g_repo, 2, 0, 0, 0, 0, 0, 1, 0); + + cl_must_pass(p_mkdir(TEST_DIR "/subdir", 0777)); + cl_git_mkfile(TEST_DIR "/subdir/file", "hello!\n"); + check_status(g_repo, 2, 0, 0, 1, 0, 0, 1, 0); + + cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); + check_status(g_repo, 3, 0, 0, 0, 0, 0, 1, 0); + + git_index_free(index); +} + static int addall_match_prefix( const char *path, const char *matched_pathspec, void *payload) { @@ -301,7 +339,7 @@ cl_git_pass( git_index_add_all(index, NULL, 0, addall_match_prefix, "file.")); check_stat_data(index, TEST_DIR "/file.bar", true); - check_status(g_repo, 1, 0, 0, 1, 0, 0, 1); + check_status(g_repo, 1, 0, 0, 1, 0, 0, 1, 0); cl_git_mkfile(TEST_DIR "/file.zzz", "yet another one"); cl_git_mkfile(TEST_DIR "/more.zzz", "yet another one"); @@ -309,32 +347,32 @@ cl_git_pass(git_index_update_all(index, NULL, NULL, NULL)); check_stat_data(index, TEST_DIR "/file.bar", true); - check_status(g_repo, 1, 0, 0, 4, 0, 0, 1); + check_status(g_repo, 1, 0, 0, 4, 0, 0, 1, 0); cl_git_pass( git_index_add_all(index, NULL, 0, addall_match_prefix, "other")); check_stat_data(index, TEST_DIR "/other.zzz", true); - check_status(g_repo, 2, 0, 0, 3, 0, 0, 1); + check_status(g_repo, 2, 0, 0, 3, 0, 0, 1, 0); cl_git_pass( git_index_add_all(index, NULL, 0, addall_match_suffix, ".zzz")); - check_status(g_repo, 4, 0, 0, 1, 0, 0, 1); + check_status(g_repo, 4, 0, 0, 1, 0, 0, 1, 0); cl_git_pass( git_index_remove_all(index, NULL, addall_match_suffix, ".zzz")); - check_status(g_repo, 1, 0, 0, 4, 0, 0, 1); + check_status(g_repo, 1, 0, 0, 4, 0, 0, 1, 0); cl_git_fail_with( git_index_add_all(index, NULL, 0, addall_cancel_at, "more.zzz"), -123); - check_status(g_repo, 3, 0, 0, 2, 0, 0, 1); + check_status(g_repo, 3, 0, 0, 2, 0, 0, 1, 0); cl_git_fail_with( git_index_add_all(index, NULL, 0, addall_cancel_at, "other.zzz"), -123); - check_status(g_repo, 4, 0, 0, 1, 0, 0, 1); + check_status(g_repo, 4, 0, 0, 1, 0, 0, 1, 0); cl_git_pass( git_index_add_all(index, NULL, 0, addall_match_suffix, ".zzz")); - check_status(g_repo, 5, 0, 0, 0, 0, 0, 1); + check_status(g_repo, 5, 0, 0, 0, 0, 0, 1, 0); cl_must_pass(p_unlink(TEST_DIR "/file.zzz")); cl_must_pass(p_unlink(TEST_DIR "/more.zzz")); @@ -344,13 +382,65 @@ git_index_update_all(index, NULL, addall_cancel_at, "more.zzz"), -123); /* file.zzz removed from index (so Index Adds 5 -> 4) and * more.zzz + other.zzz removed (so Worktree Dels 0 -> 2) */ - check_status(g_repo, 4, 0, 0, 0, 2, 0, 1); + check_status(g_repo, 4, 0, 0, 0, 2, 0, 1, 0); cl_git_fail_with( git_index_update_all(index, NULL, addall_cancel_at, "other.zzz"), -123); /* more.zzz removed from index (so Index Adds 4 -> 3) and * Just other.zzz removed (so Worktree Dels 2 -> 1) */ - check_status(g_repo, 3, 0, 0, 0, 1, 0, 1); + check_status(g_repo, 3, 0, 0, 0, 1, 0, 1, 0); + + git_index_free(index); +} + +void test_index_addall__adds_conflicts(void) +{ + git_index *index; + git_reference *ref; + git_annotated_commit *annotated; + + g_repo = cl_git_sandbox_init("merge-resolve"); + cl_git_pass(git_repository_index(&index, g_repo)); + + check_status(g_repo, 0, 0, 0, 0, 0, 0, 0, 0); + + cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/branch")); + cl_git_pass(git_annotated_commit_from_ref(&annotated, g_repo, ref)); + + cl_git_pass(git_merge(g_repo, (const git_annotated_commit**)&annotated, 1, NULL, NULL)); + check_status(g_repo, 0, 1, 2, 0, 0, 0, 0, 1); + + cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); + check_status(g_repo, 0, 1, 3, 0, 0, 0, 0, 0); + + git_annotated_commit_free(annotated); + git_reference_free(ref); + git_index_free(index); +} + +void test_index_addall__removes_deleted_conflicted_files(void) +{ + git_index *index; + git_reference *ref; + git_annotated_commit *annotated; + + g_repo = cl_git_sandbox_init("merge-resolve"); + cl_git_pass(git_repository_index(&index, g_repo)); + + check_status(g_repo, 0, 0, 0, 0, 0, 0, 0, 0); + + cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/branch")); + cl_git_pass(git_annotated_commit_from_ref(&annotated, g_repo, ref)); + + cl_git_pass(git_merge(g_repo, (const git_annotated_commit**)&annotated, 1, NULL, NULL)); + check_status(g_repo, 0, 1, 2, 0, 0, 0, 0, 1); + + cl_git_rmfile("merge-resolve/conflicting.txt"); + + cl_git_pass(git_index_add_all(index, NULL, 0, NULL, NULL)); + check_status(g_repo, 0, 2, 2, 0, 0, 0, 0, 0); + git_annotated_commit_free(annotated); + git_reference_free(ref); git_index_free(index); } diff -Nru libgit2-0.22.2/tests/index/bypath.c libgit2-0.23.1/tests/index/bypath.c --- libgit2-0.22.2/tests/index/bypath.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/index/bypath.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,48 @@ +#include "clar_libgit2.h" +#include "repository.h" +#include "../submodule/submodule_helpers.h" + +static git_repository *g_repo; +static git_index *g_idx; + +void test_index_bypath__initialize(void) +{ + g_repo = setup_fixture_submod2(); + cl_git_pass(git_repository_index__weakptr(&g_idx, g_repo)); +} + +void test_index_bypath__cleanup(void) +{ + g_repo = NULL; + g_idx = NULL; +} + +void test_index_bypath__add_directory(void) +{ + cl_git_fail_with(GIT_EDIRECTORY, git_index_add_bypath(g_idx, "just_a_dir")); +} + +void test_index_bypath__add_submodule(void) +{ + unsigned int status; + const char *sm_name = "sm_changed_head"; + + cl_git_pass(git_submodule_status(&status, g_repo, sm_name, 0)); + cl_assert_equal_i(GIT_SUBMODULE_STATUS_WD_MODIFIED, status & GIT_SUBMODULE_STATUS_WD_MODIFIED); + cl_git_pass(git_index_add_bypath(g_idx, sm_name)); + cl_git_pass(git_submodule_status(&status, g_repo, sm_name, 0)); + cl_assert_equal_i(0, status & GIT_SUBMODULE_STATUS_WD_MODIFIED); +} + +void test_index_bypath__add_submodule_unregistered(void) +{ + const char *sm_name = "not-submodule"; + const char *sm_head = "68e92c611b80ee1ed8f38314ff9577f0d15b2444"; + const git_index_entry *entry; + + cl_git_pass(git_index_add_bypath(g_idx, sm_name)); + + cl_assert(entry = git_index_get_bypath(g_idx, sm_name, 0)); + cl_assert_equal_s(sm_head, git_oid_tostr_s(&entry->id)); + cl_assert_equal_s(sm_name, entry->path); +} diff -Nru libgit2-0.22.2/tests/index/collision.c libgit2-0.23.1/tests/index/collision.c --- libgit2-0.22.2/tests/index/collision.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/collision.c 2015-08-03 18:07:35.000000000 +0000 @@ -57,7 +57,7 @@ git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"); entry.path = "a/b"; - entry.flags = (2 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 2); cl_git_pass(git_index_add(index, &entry)); /* create a blob beneath the previous tree entry */ @@ -67,7 +67,7 @@ /* create another tree entry above the blob */ entry.path = "a/b"; - entry.flags = (1 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 1); cl_git_pass(git_index_add(index, &entry)); git_index_free(index); @@ -89,17 +89,17 @@ git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"); entry.path = "a/b/c"; - entry.flags = (1 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 1); cl_git_pass(git_index_add(index, &entry)); /* create a blob beneath the previous tree entry */ entry.path = "a/b/c"; - entry.flags = (2 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 2); cl_git_pass(git_index_add(index, &entry)); /* create another tree entry above the blob */ entry.path = "a/b"; - entry.flags = (3 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, 3); cl_git_pass(git_index_add(index, &entry)); git_index_free(index); diff -Nru libgit2-0.22.2/tests/index/conflicts.c libgit2-0.23.1/tests/index/conflicts.c --- libgit2-0.22.2/tests/index/conflicts.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/conflicts.c 2015-08-03 18:07:35.000000000 +0000 @@ -16,6 +16,7 @@ #define CONFLICTS_TWO_OUR_OID "8b3f43d2402825c200f835ca1762413e386fd0b2" #define CONFLICTS_TWO_THEIR_OID "220bd62631c8cf7a83ef39c6b94595f00517211e" +#define TEST_STAGED_OID "beefdadafeedabedcafedeedbabedeadbeaddeaf" #define TEST_ANCESTOR_OID "f00ff00ff00ff00ff00ff00ff00ff00ff00ff00f" #define TEST_OUR_OID "b44bb44bb44bb44bb44bb44bb44bb44bb44bb44b" #define TEST_THEIR_OID "0123456789abcdef0123456789abcdef01234567" @@ -46,15 +47,18 @@ memset(&their_entry, 0x0, sizeof(git_index_entry)); ancestor_entry.path = "test-one.txt"; - ancestor_entry.flags |= (1 << GIT_IDXENTRY_STAGESHIFT); + ancestor_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1); git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); our_entry.path = "test-one.txt"; - ancestor_entry.flags |= (2 << GIT_IDXENTRY_STAGESHIFT); + our_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&our_entry, 2); git_oid_fromstr(&our_entry.id, TEST_OUR_OID); their_entry.path = "test-one.txt"; - ancestor_entry.flags |= (3 << GIT_IDXENTRY_STAGESHIFT); + their_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 2); git_oid_fromstr(&their_entry.id, TEST_THEIR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -74,15 +78,18 @@ memset(&their_entry, 0x0, sizeof(git_index_entry)); ancestor_entry.path = "test-one.txt"; - ancestor_entry.flags |= (3 << GIT_IDXENTRY_STAGESHIFT); + ancestor_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3); git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); our_entry.path = "test-one.txt"; - ancestor_entry.flags |= (1 << GIT_IDXENTRY_STAGESHIFT); + our_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&our_entry, 1); git_oid_fromstr(&our_entry.id, TEST_OUR_OID); their_entry.path = "test-one.txt"; - ancestor_entry.flags |= (2 << GIT_IDXENTRY_STAGESHIFT); + their_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&their_entry, 2); git_oid_fromstr(&their_entry.id, TEST_THEIR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); @@ -96,6 +103,55 @@ cl_assert(git_index_entry_stage(conflict_entry[2]) == 3); } +void test_index_conflicts__add_removes_stage_zero(void) +{ + git_index_entry staged, ancestor_entry, our_entry, their_entry; + const git_index_entry *conflict_entry[3]; + + cl_assert(git_index_entrycount(repo_index) == 8); + + memset(&staged, 0x0, sizeof(git_index_entry)); + memset(&ancestor_entry, 0x0, sizeof(git_index_entry)); + memset(&our_entry, 0x0, sizeof(git_index_entry)); + memset(&their_entry, 0x0, sizeof(git_index_entry)); + + staged.path = "test-one.txt"; + staged.mode = 0100644; + git_oid_fromstr(&staged.id, TEST_STAGED_OID); + cl_git_pass(git_index_add(repo_index, &staged)); + cl_assert(git_index_entrycount(repo_index) == 9); + + ancestor_entry.path = "test-one.txt"; + ancestor_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3); + git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); + + our_entry.path = "test-one.txt"; + our_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&our_entry, 1); + git_oid_fromstr(&our_entry.id, TEST_OUR_OID); + + their_entry.path = "test-one.txt"; + their_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&their_entry, 2); + git_oid_fromstr(&their_entry.id, TEST_THEIR_OID); + + cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry)); + + cl_assert(git_index_entrycount(repo_index) == 11); + + cl_assert_equal_p(NULL, git_index_get_bypath(repo_index, "test-one.txt", 0)); + + cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], repo_index, "test-one.txt")); + + cl_assert_equal_oid(&ancestor_entry.id, &conflict_entry[0]->id); + cl_assert_equal_i(1, git_index_entry_stage(conflict_entry[0])); + cl_assert_equal_oid(&our_entry.id, &conflict_entry[1]->id); + cl_assert_equal_i(2, git_index_entry_stage(conflict_entry[1])); + cl_assert_equal_oid(&their_entry.id, &conflict_entry[2]->id); + cl_assert_equal_i(3, git_index_entry_stage(conflict_entry[2])); +} + void test_index_conflicts__get(void) { const git_index_entry *conflict_entry[3]; @@ -216,7 +272,7 @@ cl_assert(entry = git_index_get_byindex(repo_index, i)); if (strcmp(entry->path, "conflicts-one.txt") == 0) - cl_assert(git_index_entry_stage(entry) == 0); + cl_assert(!git_index_entry_is_conflict(entry)); } } @@ -256,7 +312,7 @@ for (i = 0; i < git_index_entrycount(repo_index); i++) { cl_assert(entry = git_index_get_byindex(repo_index, i)); - cl_assert(git_index_entry_stage(entry) == 0); + cl_assert(!git_index_entry_is_conflict(entry)); } } @@ -272,7 +328,8 @@ memset(&their_entry, 0x0, sizeof(git_index_entry)); ancestor_entry.path = "test-one.txt"; - ancestor_entry.flags |= (1 << GIT_IDXENTRY_STAGESHIFT); + ancestor_entry.mode = 0100644; + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1); git_oid_fromstr(&ancestor_entry.id, TEST_ANCESTOR_OID); cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, NULL, NULL)); diff -Nru libgit2-0.22.2/tests/index/filemodes.c libgit2-0.23.1/tests/index/filemodes.c --- libgit2-0.22.2/tests/index/filemodes.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/filemodes.c 2015-08-03 18:07:35.000000000 +0000 @@ -153,6 +153,85 @@ git_index_free(index); } +#define add_entry_and_check_mode(I,FF,X) add_entry_and_check_mode_(I,FF,X,__FILE__,__LINE__) + +static void add_entry_and_check_mode_( + git_index *index, bool from_file, git_filemode_t mode, + const char *file, int line) +{ + size_t pos; + const git_index_entry* entry; + git_index_entry new_entry; + + /* If old_filename exists, we copy that to the new file, and test + * git_index_add(), otherwise create a new entry testing git_index_add_frombuffer + */ + if (from_file) + { + clar__assert(!git_index_find(&pos, index, "exec_off"), + file, line, "Cannot find original index entry", NULL, 1); + + entry = git_index_get_byindex(index, pos); + + memcpy(&new_entry, entry, sizeof(new_entry)); + } + else + memset(&new_entry, 0x0, sizeof(git_index_entry)); + + new_entry.path = "filemodes/explicit_test"; + new_entry.mode = mode; + + if (from_file) + { + clar__assert(!git_index_add(index, &new_entry), + file, line, "Cannot add index entry", NULL, 1); + } + else + { + const char *content = "hey there\n"; + clar__assert(!git_index_add_frombuffer(index, &new_entry, content, strlen(content)), + file, line, "Cannot add index entry from buffer", NULL, 1); + } + + clar__assert(!git_index_find(&pos, index, "filemodes/explicit_test"), + file, line, "Cannot find new index entry", NULL, 1); + + entry = git_index_get_byindex(index, pos); + + clar__assert_equal(file, line, "Expected mode does not match index", + 1, "%07o", (unsigned int)entry->mode, (unsigned int)mode); +} + +void test_index_filemodes__explicit(void) +{ + git_index *index; + + /* These tests should run and work everywhere, as the filemode is + * given explicitly to git_index_add or git_index_add_frombuffer + */ + cl_repo_set_bool(g_repo, "core.filemode", false); + + cl_git_pass(git_repository_index(&index, g_repo)); + + /* Each of these tests keeps overwriting the same file in the index. */ + /* 1 - add new 0644 entry */ + add_entry_and_check_mode(index, true, GIT_FILEMODE_BLOB); + + /* 2 - add 0755 entry over existing 0644 */ + add_entry_and_check_mode(index, true, GIT_FILEMODE_BLOB_EXECUTABLE); + + /* 3 - add 0644 entry over existing 0755 */ + add_entry_and_check_mode(index, true, GIT_FILEMODE_BLOB); + + /* 4 - add 0755 buffer entry over existing 0644 */ + add_entry_and_check_mode(index, false, GIT_FILEMODE_BLOB_EXECUTABLE); + + /* 5 - add 0644 buffer entry over existing 0755 */ + add_entry_and_check_mode(index, false, GIT_FILEMODE_BLOB); + + git_index_free(index); +} + void test_index_filemodes__invalid(void) { git_index *index; diff -Nru libgit2-0.22.2/tests/index/names.c libgit2-0.23.1/tests/index/names.c --- libgit2-0.22.2/tests/index/names.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/names.c 2015-08-03 18:07:35.000000000 +0000 @@ -89,7 +89,7 @@ cl_git_pass(git_revparse_single(&target, repo, "3a34580")); test_index_names__add(); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); cl_assert(git_index_name_entrycount(repo_index) == 0); git_object_free(target); @@ -102,7 +102,7 @@ cl_git_pass(git_revparse_single(&target, repo, "3a34580")); test_index_names__add(); - cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL)); cl_assert(git_index_name_entrycount(repo_index) == 0); git_object_free(target); diff -Nru libgit2-0.22.2/tests/index/racy.c libgit2-0.23.1/tests/index/racy.c --- libgit2-0.22.2/tests/index/racy.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/index/racy.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,147 @@ +#include "clar_libgit2.h" +#include "../checkout/checkout_helpers.h" + +#include "buffer.h" +#include "index.h" +#include "repository.h" + +static git_repository *g_repo; + +void test_index_racy__initialize(void) +{ + cl_git_pass(git_repository_init(&g_repo, "diff_racy", false)); +} + +void test_index_racy__cleanup(void) +{ + git_repository_free(g_repo); + g_repo = NULL; + + cl_fixture_cleanup("diff_racy"); +} + +void test_index_racy__diff(void) +{ + git_index *index; + git_diff *diff; + git_buf path = GIT_BUF_INIT; + + cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A")); + cl_git_mkfile(path.ptr, "A"); + + /* Put 'A' into the index */ + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_add_bypath(index, "A")); + cl_git_pass(git_index_write(index)); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL)); + cl_assert_equal_i(0, git_diff_num_deltas(diff)); + git_diff_free(diff); + + /* Change its contents quickly, so we get the same timestamp */ + cl_git_mkfile(path.ptr, "B"); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL)); + cl_assert_equal_i(1, git_diff_num_deltas(diff)); + + git_index_free(index); + git_diff_free(diff); + git_buf_free(&path); +} + +void test_index_racy__write_index_just_after_file(void) +{ + git_index *index; + git_diff *diff; + git_buf path = GIT_BUF_INIT; + struct timeval times[2]; + + /* Make sure we do have a timestamp */ + cl_git_pass(git_repository_index(&index, g_repo)); + cl_git_pass(git_index_write(index)); + + cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A")); + cl_git_mkfile(path.ptr, "A"); + /* Force the file's timestamp to be a second after we wrote the index */ + times[0].tv_sec = index->stamp.mtime + 1; + times[0].tv_usec = 0; + times[1].tv_sec = index->stamp.mtime + 1; + times[1].tv_usec = 0; + cl_git_pass(p_utimes(path.ptr, times)); + + /* + * Put 'A' into the index, the size field will be filled, + * because the index' on-disk timestamp does not match the + * file's timestamp. + */ + cl_git_pass(git_index_add_bypath(index, "A")); + cl_git_pass(git_index_write(index)); + + cl_git_mkfile(path.ptr, "B"); + /* + * Pretend this index' modification happend a second after the + * file update, and rewrite the file in that same second. + */ + times[0].tv_sec = index->stamp.mtime + 2; + times[0].tv_usec = 0; + times[1].tv_sec = index->stamp.mtime + 2; + times[0].tv_usec = 0; + + cl_git_pass(p_utimes(git_index_path(index), times)); + cl_git_pass(p_utimes(path.ptr, times)); + + cl_git_pass(git_index_read(index, true)); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL)); + cl_assert_equal_i(1, git_diff_num_deltas(diff)); + + git_buf_free(&path); + git_diff_free(diff); + git_index_free(index); +} + +void test_index_racy__empty_file_after_smudge(void) +{ + git_index *index; + git_diff *diff; + git_buf path = GIT_BUF_INIT; + int i, found_race = 0; + const git_index_entry *entry; + + /* Make sure we do have a timestamp */ + cl_git_pass(git_repository_index__weakptr(&index, g_repo)); + cl_git_pass(git_index_write(index)); + + cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "A")); + + /* Make sure writing the file, adding and rewriting happen in the same second */ + for (i = 0; i < 10; i++) { + struct stat st; + cl_git_mkfile(path.ptr, "A"); + + cl_git_pass(git_index_add_bypath(index, "A")); + cl_git_mkfile(path.ptr, "B"); + cl_git_pass(git_index_write(index)); + + cl_git_mkfile(path.ptr, ""); + + cl_git_pass(p_stat(path.ptr, &st)); + cl_assert(entry = git_index_get_bypath(index, "A", 0)); + if (entry->mtime.seconds == (int32_t) st.st_mtime) { + found_race = 1; + break; + } + + } + + if (!found_race) + cl_fail("failed to find race after 10 attempts"); + + cl_assert_equal_i(0, entry->file_size); + + cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL)); + cl_assert_equal_i(1, git_diff_num_deltas(diff)); + + git_buf_free(&path); + git_diff_free(diff); +} diff -Nru libgit2-0.22.2/tests/index/read_index.c libgit2-0.23.1/tests/index/read_index.c --- libgit2-0.22.2/tests/index/read_index.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/index/read_index.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,73 @@ +#include "clar_libgit2.h" +#include "posix.h" +#include "index.h" + +static git_repository *_repo; +static git_index *_index; + +void test_index_read_index__initialize(void) +{ + git_object *head; + git_reference *head_ref; + + _repo = cl_git_sandbox_init("testrepo"); + cl_git_pass(git_revparse_ext(&head, &head_ref, _repo, "HEAD")); + cl_git_pass(git_reset(_repo, head, GIT_RESET_HARD, NULL)); + cl_git_pass(git_repository_index(&_index, _repo)); + + git_reference_free(head_ref); + git_object_free(head); +} + +void test_index_read_index__cleanup(void) +{ + git_index_free(_index); + cl_git_sandbox_cleanup(); +} + +void test_index_read_index__maintains_stat_cache(void) +{ + git_index *new_index; + git_oid index_id; + git_index_entry new_entry; + const git_index_entry *e; + git_tree *tree; + size_t i; + + cl_assert_equal_i(4, git_index_entrycount(_index)); + + /* write-tree */ + cl_git_pass(git_index_write_tree(&index_id, _index)); + + /* read-tree, then read index */ + git_tree_lookup(&tree, _repo, &index_id); + cl_git_pass(git_index_new(&new_index)); + cl_git_pass(git_index_read_tree(new_index, tree)); + git_tree_free(tree); + + /* add a new entry that will not have stat data */ + memset(&new_entry, 0, sizeof(git_index_entry)); + new_entry.path = "Hello"; + git_oid_fromstr(&new_entry.id, "0123456789012345678901234567890123456789"); + new_entry.file_size = 1234; + new_entry.mode = 0100644; + cl_git_pass(git_index_add(new_index, &new_entry)); + cl_assert_equal_i(5, git_index_entrycount(new_index)); + + cl_git_pass(git_index_read_index(_index, new_index)); + git_index_free(new_index); + + cl_assert_equal_i(5, git_index_entrycount(_index)); + + for (i = 0; i < git_index_entrycount(_index); i++) { + e = git_index_get_byindex(_index, i); + + if (strcmp(e->path, "Hello") == 0) { + cl_assert_equal_i(0, e->ctime.seconds); + cl_assert_equal_i(0, e->mtime.seconds); + } else { + cl_assert(0 != e->ctime.seconds); + cl_assert(0 != e->mtime.seconds); + } + } +} diff -Nru libgit2-0.22.2/tests/index/reuc.c libgit2-0.23.1/tests/index/reuc.c --- libgit2-0.22.2/tests/index/reuc.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/reuc.c 2015-08-03 18:07:35.000000000 +0000 @@ -298,7 +298,7 @@ cl_git_pass(git_revparse_single(&target, repo, "3a34580")); test_index_reuc__add(); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); cl_assert(reuc_entry_exists() == false); git_object_free(target); @@ -311,7 +311,7 @@ cl_git_pass(git_revparse_single(&target, repo, "3a34580")); test_index_reuc__add(); - cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL)); cl_assert(reuc_entry_exists() == false); git_object_free(target); @@ -323,10 +323,10 @@ cl_git_pass(git_revparse_single(&target, repo, "3a34580")); - git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); test_index_reuc__add(); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); cl_assert(reuc_entry_exists() == true); git_object_free(target); diff -Nru libgit2-0.22.2/tests/index/tests.c libgit2-0.23.1/tests/index/tests.c --- libgit2-0.22.2/tests/index/tests.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/index/tests.c 2015-08-03 18:07:35.000000000 +0000 @@ -103,8 +103,8 @@ git_index_entry *e = entries[test_entries[i].index]; cl_assert_equal_s(e->path, test_entries[i].path); - cl_assert(e->mtime.seconds == test_entries[i].mtime); - cl_assert(e->file_size == test_entries[i].file_size); + cl_assert_equal_i(e->mtime.seconds, test_entries[i].mtime); + cl_assert_equal_i(e->file_size, test_entries[i].file_size); } git_index_free(index); @@ -253,6 +253,128 @@ git_repository_free(repo); } +void test_index_tests__add_frombuffer(void) +{ + git_index *index; + git_repository *repo; + git_index_entry entry; + const git_index_entry *returned_entry; + + git_oid id1; + git_blob *blob; + + const char *content = "hey there\n"; + + cl_set_cleanup(&cleanup_myrepo, NULL); + + /* Intialize a new repository */ + cl_git_pass(git_repository_init(&repo, "./myrepo", 0)); + + /* Ensure we're the only guy in the room */ + cl_git_pass(git_repository_index(&index, repo)); + cl_assert(git_index_entrycount(index) == 0); + + /* Store the expected hash of the file/blob + * This has been generated by executing the following + * $ echo "hey there" | git hash-object --stdin + */ + cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); + + /* Add the new file to the index */ + memset(&entry, 0x0, sizeof(git_index_entry)); + entry.mode = GIT_FILEMODE_BLOB; + entry.path = "test.txt"; + cl_git_pass(git_index_add_frombuffer(index, &entry, + content, strlen(content))); + + /* Wow... it worked! */ + cl_assert(git_index_entrycount(index) == 1); + returned_entry = git_index_get_byindex(index, 0); + + /* And the built-in hashing mechanism worked as expected */ + cl_assert_equal_oid(&id1, &returned_entry->id); + /* And mode is the one asked */ + cl_assert_equal_i(GIT_FILEMODE_BLOB, returned_entry->mode); + + /* Test access by path instead of index */ + cl_assert((returned_entry = git_index_get_bypath(index, "test.txt", 0)) != NULL); + cl_assert_equal_oid(&id1, &returned_entry->id); + + /* Test the blob is in the repository */ + cl_git_pass(git_blob_lookup(&blob, repo, &id1)); + cl_assert_equal_s( + content, git_blob_rawcontent(blob)); + git_blob_free(blob); + + git_index_free(index); + git_repository_free(repo); +} + +void test_index_tests__add_frombuffer_reset_entry(void) +{ + git_index *index; + git_repository *repo; + git_index_entry entry; + const git_index_entry *returned_entry; + git_filebuf file = GIT_FILEBUF_INIT; + + git_oid id1; + git_blob *blob; + const char *old_content = "here\n"; + const char *content = "hey there\n"; + + cl_set_cleanup(&cleanup_myrepo, NULL); + + /* Intialize a new repository */ + cl_git_pass(git_repository_init(&repo, "./myrepo", 0)); + cl_git_pass(git_repository_index(&index, repo)); + cl_git_pass(git_futils_mkpath2file("myrepo/test.txt", 0777)); + cl_git_pass(git_filebuf_open(&file, "myrepo/test.txt", 0, 0666)); + cl_git_pass(git_filebuf_write(&file, old_content, strlen(old_content))); + cl_git_pass(git_filebuf_commit(&file)); + + /* Store the expected hash of the file/blob + * This has been generated by executing the following + * $ echo "hey there" | git hash-object --stdin + */ + cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); + + cl_git_pass(git_index_add_bypath(index, "test.txt")); + + /* Add the new file to the index */ + memset(&entry, 0x0, sizeof(git_index_entry)); + entry.mode = GIT_FILEMODE_BLOB; + entry.path = "test.txt"; + cl_git_pass(git_index_add_frombuffer(index, &entry, + content, strlen(content))); + + /* Wow... it worked! */ + cl_assert(git_index_entrycount(index) == 1); + returned_entry = git_index_get_byindex(index, 0); + + /* And the built-in hashing mechanism worked as expected */ + cl_assert_equal_oid(&id1, &returned_entry->id); + /* And mode is the one asked */ + cl_assert_equal_i(GIT_FILEMODE_BLOB, returned_entry->mode); + + /* Test access by path instead of index */ + cl_assert((returned_entry = git_index_get_bypath(index, "test.txt", 0)) != NULL); + cl_assert_equal_oid(&id1, &returned_entry->id); + cl_assert_equal_i(0, returned_entry->dev); + cl_assert_equal_i(0, returned_entry->ino); + cl_assert_equal_i(0, returned_entry->uid); + cl_assert_equal_i(0, returned_entry->uid); + cl_assert_equal_i(10, returned_entry->file_size); + + /* Test the blob is in the repository */ + cl_git_pass(git_blob_lookup(&blob, repo, &id1)); + cl_assert_equal_s(content, git_blob_rawcontent(blob)); + git_blob_free(blob); + + git_index_free(index); + git_repository_free(repo); +} + static void cleanup_1397(void *opaque) { GIT_UNUSED(opaque); @@ -677,3 +799,24 @@ git_index_free(index); } + +void test_index_tests__can_lock_index(void) +{ + git_index *index; + git_indexwriter one = GIT_INDEXWRITER_INIT, + two = GIT_INDEXWRITER_INIT; + + cl_git_pass(git_index_open(&index, TEST_INDEX_PATH)); + cl_git_pass(git_indexwriter_init(&one, index)); + + cl_git_fail_with(GIT_ELOCKED, git_indexwriter_init(&two, index)); + cl_git_fail_with(GIT_ELOCKED, git_index_write(index)); + + cl_git_pass(git_indexwriter_commit(&one)); + + cl_git_pass(git_index_write(index)); + + git_indexwriter_cleanup(&one); + git_indexwriter_cleanup(&two); + git_index_free(index); +} diff -Nru libgit2-0.22.2/tests/main.c libgit2-0.23.1/tests/main.c --- libgit2-0.22.2/tests/main.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/main.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,4 +1,12 @@ + +#if defined(GIT_MSVC_CRTDBG) +/* Enable MSVC CRTDBG memory leak reporting. See src/util.h for details. */ +#include +#include +#endif + #include "clar_libgit2.h" +#include "clar_libgit2_trace.h" #ifdef _WIN32 int __cdecl main(int argc, char *argv[]) @@ -8,9 +16,22 @@ { int res; +#if defined(GIT_MSVC_CRTDBG) + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); + + _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); + _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE); + + _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR); +#endif + clar_test_init(argc, argv); git_libgit2_init(); + cl_global_trace_register(); cl_sandbox_set_search_path_defaults(); /* Run the test suite */ @@ -18,7 +39,7 @@ clar_test_shutdown(); - giterr_clear(); + cl_global_trace_disable(); git_libgit2_shutdown(); return res; diff -Nru libgit2-0.22.2/tests/merge/files.c libgit2-0.23.1/tests/merge/files.c --- libgit2-0.22.2/tests/merge/files.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/files.c 2015-08-03 18:07:35.000000000 +0000 @@ -173,3 +173,118 @@ git_merge_file_result_free(&result); } + +void test_merge_files__automerge_whitespace_eol(void) +{ + git_merge_file_input ancestor = GIT_MERGE_FILE_INPUT_INIT, + ours = GIT_MERGE_FILE_INPUT_INIT, + theirs = GIT_MERGE_FILE_INPUT_INIT; + git_merge_file_options opts = GIT_MERGE_FILE_OPTIONS_INIT; + git_merge_file_result result = {0}; + const char *expected = "Zero\n1\n2\n3\n4\n5\n6\n7\n8\n9\nTen\n"; + + ancestor.ptr = "0 \n1\n2\n3\n4\n5\n6\n7\n8\n9\n10 \n"; + ancestor.size = strlen(ancestor.ptr); + ancestor.path = "testfile.txt"; + ancestor.mode = 0100755; + + ours.ptr = "Zero\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n"; + ours.size = strlen(ours.ptr); + ours.path = "testfile.txt"; + ours.mode = 0100755; + + theirs.ptr = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\nTen\n"; + theirs.size = strlen(theirs.ptr); + theirs.path = "testfile.txt"; + theirs.mode = 0100755; + + opts.flags |= GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL; + cl_git_pass(git_merge_file(&result, &ancestor, &ours, &theirs, &opts)); + + cl_assert_equal_i(1, result.automergeable); + + cl_assert_equal_s("testfile.txt", result.path); + cl_assert_equal_i(0100755, result.mode); + + cl_assert_equal_i(strlen(expected), result.len); + cl_assert_equal_strn(expected, result.ptr, result.len); + + git_merge_file_result_free(&result); +} + +void test_merge_files__automerge_whitespace_change(void) +{ + git_merge_file_input ancestor = GIT_MERGE_FILE_INPUT_INIT, + ours = GIT_MERGE_FILE_INPUT_INIT, + theirs = GIT_MERGE_FILE_INPUT_INIT; + git_merge_file_options opts = GIT_MERGE_FILE_OPTIONS_INIT; + git_merge_file_result result = {0}; + const char *expected = "Zero\n1\n2\n3\n4\n5 XXX\n6 YYY\n7\n8\n9\nTen\n"; + + ancestor.ptr = "0\n1\n2\n3\n4\n5 XXX\n6YYY\n7\n8\n9\n10\n"; + ancestor.size = strlen(ancestor.ptr); + ancestor.path = "testfile.txt"; + ancestor.mode = 0100755; + + ours.ptr = "Zero\n1\n2\n3\n4\n5 XXX\n6 YYY\n7\n8\n9\n10\n"; + ours.size = strlen(ours.ptr); + ours.path = "testfile.txt"; + ours.mode = 0100755; + + theirs.ptr = "0\n1\n2\n3\n4\n5 XXX\n6 YYY\n7\n8\n9\nTen\n"; + theirs.size = strlen(theirs.ptr); + theirs.path = "testfile.txt"; + theirs.mode = 0100755; + + opts.flags |= GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE; + cl_git_pass(git_merge_file(&result, &ancestor, &ours, &theirs, &opts)); + + cl_assert_equal_i(1, result.automergeable); + + cl_assert_equal_s("testfile.txt", result.path); + cl_assert_equal_i(0100755, result.mode); + + cl_assert_equal_i(strlen(expected), result.len); + cl_assert_equal_strn(expected, result.ptr, result.len); + + git_merge_file_result_free(&result); +} + +void test_merge_files__doesnt_add_newline(void) +{ + git_merge_file_input ancestor = GIT_MERGE_FILE_INPUT_INIT, + ours = GIT_MERGE_FILE_INPUT_INIT, + theirs = GIT_MERGE_FILE_INPUT_INIT; + git_merge_file_options opts = GIT_MERGE_FILE_OPTIONS_INIT; + git_merge_file_result result = {0}; + const char *expected = "Zero\n1\n2\n3\n4\n5 XXX\n6 YYY\n7\n8\n9\nTen"; + + ancestor.ptr = "0\n1\n2\n3\n4\n5 XXX\n6YYY\n7\n8\n9\n10"; + ancestor.size = strlen(ancestor.ptr); + ancestor.path = "testfile.txt"; + ancestor.mode = 0100755; + + ours.ptr = "Zero\n1\n2\n3\n4\n5 XXX\n6 YYY\n7\n8\n9\n10"; + ours.size = strlen(ours.ptr); + ours.path = "testfile.txt"; + ours.mode = 0100755; + + theirs.ptr = "0\n1\n2\n3\n4\n5 XXX\n6 YYY\n7\n8\n9\nTen"; + theirs.size = strlen(theirs.ptr); + theirs.path = "testfile.txt"; + theirs.mode = 0100755; + + opts.flags |= GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE; + cl_git_pass(git_merge_file(&result, &ancestor, &ours, &theirs, &opts)); + + cl_assert_equal_i(1, result.automergeable); + + cl_assert_equal_s("testfile.txt", result.path); + cl_assert_equal_i(0100755, result.mode); + + cl_assert_equal_i(strlen(expected), result.len); + cl_assert_equal_strn(expected, result.ptr, result.len); + + git_merge_file_result_free(&result); +} + diff -Nru libgit2-0.22.2/tests/merge/merge_helpers.c libgit2-0.23.1/tests/merge/merge_helpers.c --- libgit2-0.22.2/tests/merge/merge_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/merge_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -90,7 +90,7 @@ head_checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; - cl_git_pass(git_reference_symbolic_create(&head_ref, repo, "HEAD", ours_branch, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&head_ref, repo, "HEAD", ours_branch, 1, NULL)); cl_git_pass(git_checkout_head(repo, &head_checkout_opts)); cl_git_pass(git_reference_lookup(&theirs_ref, repo, theirs_branch)); @@ -110,7 +110,7 @@ size_t i; const git_index_entry *index_entry; - printf ("\nINDEX [%d]:\n", (int)index_entries->length); + printf ("\nINDEX [%"PRIuZ"]:\n", index_entries->length); for (i = 0; i < index_entries->length; i++) { index_entry = index_entries->contents[i]; diff -Nru libgit2-0.22.2/tests/merge/trees/treediff.c libgit2-0.23.1/tests/merge/trees/treediff.c --- libgit2-0.22.2/tests/merge/trees/treediff.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/trees/treediff.c 2015-08-03 18:07:35.000000000 +0000 @@ -43,9 +43,10 @@ git_merge_diff_list *merge_diff_list = git_merge_diff_list__alloc(repo); git_oid ancestor_oid, ours_oid, theirs_oid; git_tree *ancestor_tree, *ours_tree, *theirs_tree; + git_iterator *ancestor_iter, *ours_iter, *theirs_iter; git_merge_options opts = GIT_MERGE_OPTIONS_INIT; - opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; opts.target_limit = 1000; opts.rename_threshold = 50; @@ -66,7 +67,14 @@ cl_git_pass(git_tree_lookup(&ours_tree, repo, &ours_oid)); cl_git_pass(git_tree_lookup(&theirs_tree, repo, &theirs_oid)); - cl_git_pass(git_merge_diff_list__find_differences(merge_diff_list, ancestor_tree, ours_tree, theirs_tree)); + cl_git_pass(git_iterator_for_tree(&ancestor_iter, ancestor_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + cl_git_pass(git_iterator_for_tree(&ours_iter, ours_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + cl_git_pass(git_iterator_for_tree(&theirs_iter, theirs_tree, + GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL)); + + cl_git_pass(git_merge_diff_list__find_differences(merge_diff_list, ancestor_iter, ours_iter, theirs_iter)); cl_git_pass(git_merge_diff_list__find_renames(repo, merge_diff_list, &opts)); /* @@ -77,6 +85,10 @@ cl_assert(merge_test_merge_conflicts(&merge_diff_list->conflicts, treediff_conflict_data, treediff_conflict_data_len)); + git_iterator_free(ancestor_iter); + git_iterator_free(ours_iter); + git_iterator_free(theirs_iter); + git_tree_free(ancestor_tree); git_tree_free(ours_tree); git_tree_free(theirs_tree); diff -Nru libgit2-0.22.2/tests/merge/trees/trivial.c libgit2-0.23.1/tests/merge/trees/trivial.c --- libgit2-0.22.2/tests/merge/trees/trivial.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/trees/trivial.c 2015-08-03 18:07:35.000000000 +0000 @@ -71,7 +71,7 @@ for (i = 0; i < git_index_entrycount(index); i++) { cl_assert(entry = git_index_get_byindex(index, i)); - if (git_index_entry_stage(entry) > 0) + if (git_index_entry_is_conflict(entry)) count++; } diff -Nru libgit2-0.22.2/tests/merge/trees/whitespace.c libgit2-0.23.1/tests/merge/trees/whitespace.c --- libgit2-0.22.2/tests/merge/trees/whitespace.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/merge/trees/whitespace.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,82 @@ +#include "clar_libgit2.h" +#include "git2/repository.h" +#include "git2/merge.h" +#include "buffer.h" +#include "merge.h" +#include "../merge_helpers.h" +#include "fileops.h" + +static git_repository *repo; + +#define TEST_REPO_PATH "merge-whitespace" + +#define BRANCH_A_EOL "branch_a_eol" +#define BRANCH_B_EOL "branch_b_eol" + +#define BRANCH_A_CHANGE "branch_a_change" +#define BRANCH_B_CHANGE "branch_b_change" + +// Fixture setup and teardown +void test_merge_trees_whitespace__initialize(void) +{ + repo = cl_git_sandbox_init(TEST_REPO_PATH); +} + +void test_merge_trees_whitespace__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_merge_trees_whitespace__conflict(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "4026a6c83f39c56881c9ac62e7582db9e3d33a4f", 1, "test.txt" }, + { 0100644, "c3b1fb31424c98072542cc8e42b48c92e52f494a", 2, "test.txt" }, + { 0100644, "262f67de0de2e535a59ae1bc3c739601e98c354d", 3, "test.txt" }, + }; + + cl_git_pass(merge_trees_from_branches(&index, repo, BRANCH_A_EOL, BRANCH_B_EOL, &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 3)); + + git_index_free(index); +} + +void test_merge_trees_whitespace__eol(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "ee3c2aac8e03224c323b58ecb1f9eef616745467", 0, "test.txt" }, + }; + + opts.file_flags |= GIT_MERGE_FILE_IGNORE_WHITESPACE_EOL; + + cl_git_pass(merge_trees_from_branches(&index, repo, BRANCH_A_EOL, BRANCH_B_EOL, &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 1)); + + git_index_free(index); +} + +void test_merge_trees_whitespace__change(void) +{ + git_index *index; + git_merge_options opts = GIT_MERGE_OPTIONS_INIT; + + struct merge_index_entry merge_index_entries[] = { + { 0100644, "a827eab4fd66ab37a6ebcfaa7b7e341abfd55947", 0, "test.txt" }, + }; + + opts.file_flags |= GIT_MERGE_FILE_IGNORE_WHITESPACE_CHANGE; + + cl_git_pass(merge_trees_from_branches(&index, repo, BRANCH_A_CHANGE, BRANCH_B_CHANGE, &opts)); + + cl_assert(merge_test_index(index, merge_index_entries, 1)); + + git_index_free(index); +} diff -Nru libgit2-0.22.2/tests/merge/workdir/dirty.c libgit2-0.23.1/tests/merge/workdir/dirty.c --- libgit2-0.22.2/tests/merge/workdir/dirty.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/workdir/dirty.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,6 +2,7 @@ #include "git2/merge.h" #include "buffer.h" #include "merge.h" +#include "index.h" #include "../merge_helpers.h" #include "posix.h" @@ -132,12 +133,25 @@ struct stat statbuf; git_buf path = GIT_BUF_INIT; git_index_entry *entry; + struct timeval times[2]; + time_t now; size_t i; /* Update the index to suggest that checkout placed these files on * disk, keeping the object id but updating the cache, which will * emulate a Git implementation's different filter. + * + * We set the file's timestamp to before now to pretend that + * it was an old checkout so we don't trigger the racy + * protections would would check the content. */ + + now = time(NULL); + times[0].tv_sec = now - 5; + times[0].tv_usec = 0; + times[1].tv_sec = now - 5; + times[1].tv_usec = 0; + for (i = 0, filename = files[i]; filename; filename = files[++i]) { git_buf_clear(&path); @@ -145,6 +159,7 @@ git_index_get_bypath(repo_index, filename, 0)); cl_git_pass(git_buf_printf(&path, "%s/%s", TEST_REPO_PATH, filename)); + cl_git_pass(p_utimes(path.ptr, times)); cl_git_pass(p_stat(path.ptr, &statbuf)); entry->ctime.seconds = (git_time_t)statbuf.st_ctime; @@ -182,7 +197,7 @@ cl_git_pass(git_repository_head(&head, repo)); cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL)); for (i = 0, filename = content[i], text = content[++i]; filename && text; @@ -209,7 +224,7 @@ cl_git_pass(git_repository_head(&head, repo)); cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL)); write_files(dirty_files); @@ -229,7 +244,17 @@ cl_git_pass(git_repository_head(&head, repo)); cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL)); + + /* Emulate checkout with a broken or misconfigured filter: modify some + * files on-disk and then update the index with the updated file size + * and time, as if some filter applied them. These files should not be + * treated as dirty since we created them. + * + * (Make sure to update the index stamp to defeat racy-git protections + * trying to sanity check the files in the index; those would rehash the + * files, showing them as dirty, the exact mechanism we're trying to avoid.) + */ write_files(files); hack_index(files); @@ -266,7 +291,7 @@ cl_git_pass(git_repository_head(&head, repo)); cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL)); cl_git_pass(p_unlink("merge-resolve/unchanged.txt")); diff -Nru libgit2-0.22.2/tests/merge/workdir/renames.c libgit2-0.23.1/tests/merge/workdir/renames.c --- libgit2-0.22.2/tests/merge/workdir/renames.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/workdir/renames.c 2015-08-03 18:07:35.000000000 +0000 @@ -63,7 +63,7 @@ { 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" }, }; - merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; merge_opts.rename_threshold = 50; cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL)); @@ -99,7 +99,7 @@ { 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 0, "7-both-renamed.txt" }, }; - merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; merge_opts.rename_threshold = 50; checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS; @@ -147,7 +147,7 @@ { 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 0, "7-both-renamed.txt~rename_conflict_theirs" }, }; - merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; merge_opts.rename_threshold = 50; cl_git_pass(merge_branches(repo, GIT_REFS_HEADS_DIR BRANCH_RENAME_OURS, GIT_REFS_HEADS_DIR BRANCH_RENAME_THEIRS, &merge_opts, NULL)); diff -Nru libgit2-0.22.2/tests/merge/workdir/setup.c libgit2-0.23.1/tests/merge/workdir/setup.c --- libgit2-0.22.2/tests/merge/workdir/setup.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/workdir/setup.c 2015-08-03 18:07:35.000000000 +0000 @@ -1018,6 +1018,7 @@ git_annotated_commit_free(their_heads[0]); } + void test_merge_workdir_setup__removed_after_failure(void) { git_oid our_oid; @@ -1030,16 +1031,63 @@ cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH)); cl_git_pass(git_annotated_commit_from_ref(&their_heads[0], repo, octo1_ref)); + cl_git_write2file("merge-resolve/.git/index.lock", "foo\n", 4, O_RDWR|O_CREAT, 0666); + + cl_git_fail(git_merge( + repo, (const git_annotated_commit **)&their_heads[0], 1, NULL, NULL)); + + cl_assert(!git_path_exists("merge-resolve/.git/" GIT_MERGE_HEAD_FILE)); + cl_assert(!git_path_exists("merge-resolve/.git/" GIT_MERGE_MODE_FILE)); + cl_assert(!git_path_exists("merge-resolve/.git/" GIT_MERGE_MSG_FILE)); + + git_reference_free(octo1_ref); + + git_annotated_commit_free(our_head); + git_annotated_commit_free(their_heads[0]); +} + +void test_merge_workdir_setup__unlocked_after_success(void) +{ + git_oid our_oid; + git_reference *octo1_ref; + git_annotated_commit *our_head, *their_heads[1]; + + cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD)); + cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid)); + + cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH)); + cl_git_pass(git_annotated_commit_from_ref(&their_heads[0], repo, octo1_ref)); + + cl_git_pass(git_merge( + repo, (const git_annotated_commit **)&their_heads[0], 1, NULL, NULL)); + + cl_assert(!git_path_exists("merge-resolve/.git/index.lock")); + + git_reference_free(octo1_ref); + + git_annotated_commit_free(our_head); + git_annotated_commit_free(their_heads[0]); +} + +void test_merge_workdir_setup__unlocked_after_conflict(void) +{ + git_oid our_oid; + git_reference *octo1_ref; + git_annotated_commit *our_head, *their_heads[1]; + + cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD)); + cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid)); + + cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH)); + cl_git_pass(git_annotated_commit_from_ref(&their_heads[0], repo, octo1_ref)); + cl_git_rewritefile("merge-resolve/new-in-octo1.txt", "Conflicting file!\n\nMerge will fail!\n"); cl_git_fail(git_merge( repo, (const git_annotated_commit **)&their_heads[0], 1, NULL, NULL)); - cl_assert(!git_path_exists("merge-resolve/" GIT_MERGE_HEAD_FILE)); - cl_assert(!git_path_exists("merge-resolve/" GIT_ORIG_HEAD_FILE)); - cl_assert(!git_path_exists("merge-resolve/" GIT_MERGE_MODE_FILE)); - cl_assert(!git_path_exists("merge-resolve/" GIT_MERGE_MSG_FILE)); + cl_assert(!git_path_exists("merge-resolve/.git/index.lock")); git_reference_free(octo1_ref); diff -Nru libgit2-0.22.2/tests/merge/workdir/simple.c libgit2-0.23.1/tests/merge/workdir/simple.c --- libgit2-0.22.2/tests/merge/workdir/simple.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/workdir/simple.c 2015-08-03 18:07:35.000000000 +0000 @@ -521,10 +521,10 @@ { 0100644, "f5504f36e6f4eb797a56fc5bac6c6c7f32969bf2", 3, "file-5/new" }, }; - cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, GIT_REFS_HEADS_DIR OURS_DIRECTORY_FILE, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, GIT_REFS_HEADS_DIR OURS_DIRECTORY_FILE, 1, NULL)); cl_git_pass(git_reference_name_to_id(&head_commit_id, repo, GIT_HEAD_FILE)); cl_git_pass(git_commit_lookup(&head_commit, repo, &head_commit_id)); - cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD, NULL)); cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_DIRECTORY_FILE)); cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &their_oids[0])); @@ -616,7 +616,7 @@ cl_git_pass(git_oid_fromstr(&their_oid, "ad01aebfdf2ac13145efafe3f9fcf798882f1730")); cl_git_pass(git_commit_lookup(&our_commit, repo, &our_oid)); - cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL)); cl_git_pass(git_annotated_commit_lookup(&their_head, repo, &their_oid)); diff -Nru libgit2-0.22.2/tests/merge/workdir/submodules.c libgit2-0.23.1/tests/merge/workdir/submodules.c --- libgit2-0.22.2/tests/merge/workdir/submodules.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/workdir/submodules.c 2015-08-03 18:07:35.000000000 +0000 @@ -44,7 +44,7 @@ cl_git_pass(git_reference_lookup(&our_ref, repo, "refs/heads/" SUBMODULE_MAIN_BRANCH)); cl_git_pass(git_commit_lookup(&our_commit, repo, git_reference_target(our_ref))); - cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL)); cl_git_pass(git_reference_lookup(&their_ref, repo, "refs/heads/" SUBMODULE_OTHER_BRANCH)); cl_git_pass(git_annotated_commit_from_ref(&their_head, repo, their_ref)); @@ -77,7 +77,7 @@ cl_git_pass(git_reference_lookup(&our_ref, repo, "refs/heads/" SUBMODULE_MAIN_BRANCH)); cl_git_pass(git_commit_lookup(&our_commit, repo, git_reference_target(our_ref))); - cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL)); cl_git_pass(git_reference_lookup(&their_ref, repo, "refs/heads/" SUBMODULE_OTHER2_BRANCH)); cl_git_pass(git_annotated_commit_from_ref(&their_head, repo, their_ref)); diff -Nru libgit2-0.22.2/tests/merge/workdir/trivial.c libgit2-0.23.1/tests/merge/workdir/trivial.c --- libgit2-0.22.2/tests/merge/workdir/trivial.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/merge/workdir/trivial.c 2015-08-03 18:07:35.000000000 +0000 @@ -38,7 +38,7 @@ checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; git_buf_printf(&branch_buf, "%s%s", GIT_REFS_HEADS_DIR, ours); - cl_git_pass(git_reference_symbolic_create(&our_ref, repo, "HEAD", branch_buf.ptr, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&our_ref, repo, "HEAD", branch_buf.ptr, 1, NULL)); cl_git_pass(git_checkout_head(repo, &checkout_opts)); @@ -66,7 +66,7 @@ for (i = 0; i < git_index_entrycount(repo_index); i++) { cl_assert(entry = git_index_get_byindex(repo_index, i)); - if (git_index_entry_stage(entry) > 0) + if (git_index_entry_is_conflict(entry)) count++; } diff -Nru libgit2-0.22.2/tests/network/fetchlocal.c libgit2-0.23.1/tests/network/fetchlocal.c --- libgit2-0.22.2/tests/network/fetchlocal.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/network/fetchlocal.c 2015-08-03 18:07:35.000000000 +0000 @@ -34,19 +34,16 @@ git_strarray refnames = {0}; const char *url = cl_git_fixture_url("testrepo.git"); - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; - callbacks.transfer_progress = transfer_cb; - callbacks.payload = &callcount; + options.callbacks.transfer_progress = transfer_cb; + options.callbacks.payload = &callcount; cl_set_cleanup(&cleanup_local_repo, "foo"); cl_git_pass(git_repository_init(&repo, "foo", true)); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_connect(origin, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(origin, NULL)); - cl_git_pass(git_remote_update_tips(origin, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(19, (int)refnames.count); @@ -66,17 +63,16 @@ git_reference *ref; git_repository *remote_repo = cl_git_sandbox_init("testrepo.git"); const char *url = cl_git_path_url(git_repository_path(remote_repo)); - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; - callbacks.transfer_progress = transfer_cb; - callbacks.payload = &callcount; + options.callbacks.transfer_progress = transfer_cb; + options.callbacks.payload = &callcount; cl_set_cleanup(&cleanup_local_repo, "foo"); cl_git_pass(git_repository_init(&repo, "foo", true)); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(19, (int)refnames.count); @@ -89,11 +85,8 @@ git_reference_free(ref); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_connect(origin, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(origin, NULL)); - cl_git_pass(git_remote_prune(origin)); - cl_git_pass(git_remote_update_tips(origin, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); + cl_git_pass(git_remote_prune(origin, &options.callbacks)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(18, (int)refnames.count); @@ -105,11 +98,8 @@ git_reference_free(ref); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_connect(origin, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(origin, NULL)); - cl_git_pass(git_remote_prune(origin)); - cl_git_pass(git_remote_update_tips(origin, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); + cl_git_pass(git_remote_prune(origin, &options.callbacks)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(17, (int)refnames.count); @@ -151,21 +141,20 @@ git_repository *remote_repo = cl_git_sandbox_init("testrepo.git"); const char *url = cl_git_path_url(git_repository_path(remote_repo)); - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; - callbacks.transfer_progress = transfer_cb; - callbacks.payload = &callcount; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; + options.callbacks.transfer_progress = transfer_cb; + options.callbacks.payload = &callcount; cl_git_pass(git_reference_lookup(&ref, remote_repo, "refs/heads/master")); git_oid_cpy(&target, git_reference_target(ref)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, remote_repo, "refs/pull/42/head", &target, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, remote_repo, "refs/pull/42/head", &target, 1, NULL)); git_reference_free(ref); cl_set_cleanup(&cleanup_local_repo, "foo"); cl_git_pass(git_repository_init(&repo, "foo", true)); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); - git_remote_set_callbacks(origin, &callbacks); cl_git_pass(git_repository_config(&config, repo)); cl_git_pass(git_config_set_bool(config, "remote.origin.prune", true)); @@ -173,8 +162,7 @@ git_remote_free(origin); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); assert_ref_exists(repo, "refs/remotes/origin/master"); assert_ref_exists(repo, "refs/remotes/origin/pr/42"); @@ -188,9 +176,8 @@ git_remote_free(origin); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); - callbacks.update_tips = update_tips_fail_on_call; - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + options.callbacks.update_tips = update_tips_fail_on_call; + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); assert_ref_exists(repo, "refs/remotes/origin/master"); assert_ref_exists(repo, "refs/remotes/origin/pr/42"); @@ -204,9 +191,8 @@ git_remote_free(origin); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); - callbacks.update_tips = update_tips_fail_on_call; - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + options.callbacks.update_tips = update_tips_fail_on_call; + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); git_config_free(config); git_strarray_free(&refnames); @@ -224,17 +210,16 @@ git_config *config; git_repository *remote_repo = cl_git_sandbox_init("testrepo.git"); const char *url = cl_git_path_url(git_repository_path(remote_repo)); - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; - callbacks.transfer_progress = transfer_cb; - callbacks.payload = &callcount; + options.callbacks.transfer_progress = transfer_cb; + options.callbacks.payload = &callcount; cl_set_cleanup(&cleanup_local_repo, "foo"); cl_git_pass(git_repository_init(&repo, "foo", true)); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(19, (int)refnames.count); @@ -247,9 +232,8 @@ git_reference_free(ref); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); - cl_git_pass(git_remote_prune(origin)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); + cl_git_pass(git_remote_prune(origin, &options.callbacks)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(18, (int)refnames.count); @@ -265,8 +249,7 @@ git_config_free(config); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); cl_assert_equal_i(1, git_remote_prune_refs(origin)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(17, (int)refnames.count); @@ -289,22 +272,21 @@ git_repository *remote_repo = cl_git_sandbox_init("testrepo.git"); const char *url = cl_git_path_url(git_repository_path(remote_repo)); - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; - callbacks.transfer_progress = transfer_cb; - callbacks.payload = &callcount; + options.callbacks.transfer_progress = transfer_cb; + options.callbacks.payload = &callcount; cl_set_cleanup(&cleanup_local_repo, "foo"); cl_git_pass(git_repository_init(&repo, "foo", true)); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); git_remote_free(origin); cl_git_pass(git_revparse_single(&obj, repo, "origin/master")); - cl_git_pass(git_reference_create(&ref, repo, "refs/remotes/origin/fake-remote", git_object_id(obj), 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, repo, "refs/remotes/origin/fake-remote", git_object_id(obj), 1, NULL)); git_reference_free(ref); /* create signature */ @@ -321,8 +303,7 @@ git_config_free(config); cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN)); cl_assert_equal_i(1, git_remote_prune_refs(origin)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); assert_ref_exists(repo, "refs/tags/some-tag"); cl_git_fail_with(GIT_ENOTFOUND, git_reference_lookup(&ref, repo, "refs/remotes/origin/fake-remote")); @@ -346,10 +327,10 @@ int callcount = 0; git_strarray refnames = {0}; const char *url; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; - callbacks.transfer_progress = transfer_cb; - callbacks.payload = &callcount; + options.callbacks.transfer_progress = transfer_cb; + options.callbacks.payload = &callcount; cl_set_cleanup(&cleanup_sandbox, NULL); cl_git_pass(git_reference_list(&refnames, repo)); @@ -357,10 +338,7 @@ url = cl_git_fixture_url("testrepo.git"); cl_git_pass(git_remote_create(&origin, repo, GIT_REMOTE_ORIGIN, url)); - git_remote_set_callbacks(origin, &callbacks); - cl_git_pass(git_remote_connect(origin, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(origin, NULL)); - cl_git_pass(git_remote_update_tips(origin, NULL, NULL)); + cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); git_strarray_free(&refnames); @@ -380,16 +358,9 @@ GIT_UNUSED(payload); - if ((error = git_remote_create(&remote, repo, name, url)) < 0) + if ((error = git_remote_create_with_fetchspec(&remote, repo, name, url, "+refs/*:refs/*")) < 0) return error; - git_remote_clear_refspecs(remote); - - if ((error = git_remote_add_fetch(remote, "+refs/*:refs/*")) < 0) { - git_remote_free(remote); - return error; - } - *out = remote; return 0; } @@ -418,27 +389,21 @@ git_repository *repo = cl_git_sandbox_init("testrepo.git"); git_remote *test, *test2; git_strarray refnames = {0}; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; cl_set_cleanup(&cleanup_sandbox, NULL); - callbacks.transfer_progress = transfer_cb; + options.callbacks.transfer_progress = transfer_cb; + cl_git_pass(git_remote_set_url(repo, "test", cl_git_fixture_url("testrepo.git"))); cl_git_pass(git_remote_lookup(&test, repo, "test")); - cl_git_pass(git_remote_set_url(test, cl_git_fixture_url("testrepo.git"))); - git_remote_set_callbacks(test, &callbacks); - cl_git_pass(git_remote_connect(test, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(test, NULL)); - cl_git_pass(git_remote_update_tips(test, NULL, NULL)); + cl_git_pass(git_remote_fetch(test, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(32, (int)refnames.count); git_strarray_free(&refnames); + cl_git_pass(git_remote_set_url(repo, "test_with_pushurl", cl_git_fixture_url("testrepo.git"))); cl_git_pass(git_remote_lookup(&test2, repo, "test_with_pushurl")); - cl_git_pass(git_remote_set_url(test2, cl_git_fixture_url("testrepo.git"))); - git_remote_set_callbacks(test2, &callbacks); - cl_git_pass(git_remote_connect(test2, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(test2, NULL)); - cl_git_pass(git_remote_update_tips(test2, NULL, NULL)); + cl_git_pass(git_remote_fetch(test2, NULL, &options, NULL)); cl_git_pass(git_reference_list(&refnames, repo)); cl_assert_equal_i(44, (int)refnames.count); @@ -463,7 +428,7 @@ { git_repository *repo; git_remote *remote; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; int callcount = 0; cl_git_pass(git_repository_init(&repo, "foo.git", true)); @@ -471,11 +436,10 @@ cl_git_pass(git_remote_create_with_fetchspec(&remote, repo, "origin", cl_git_fixture_url("testrepo.git"), "+refs/heads/*:refs/heads/*")); - callbacks.sideband_progress = sideband_cb; - callbacks.payload = &callcount; - cl_git_pass(git_remote_set_callbacks(remote, &callbacks)); + options.callbacks.sideband_progress = sideband_cb; + options.callbacks.payload = &callcount; - cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); + cl_git_pass(git_remote_fetch(remote, NULL, &options, NULL)); cl_assert(callcount != 0); git_remote_free(remote); diff -Nru libgit2-0.22.2/tests/network/refspecs.c libgit2-0.23.1/tests/network/refspecs.c --- libgit2-0.22.2/tests/network/refspecs.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/network/refspecs.c 2015-08-03 18:07:35.000000000 +0000 @@ -146,3 +146,15 @@ assert_invalid_rtransform("refs/heads/*:refs/remotes/origin/*", "master"); assert_invalid_rtransform("refs/heads/*:refs/remotes/origin/*", "refs/remotes/o/master"); } + +void test_network_refspecs__matching(void) +{ + git_refspec spec; + + cl_git_pass(git_refspec__parse(&spec, ":", false)); + cl_assert_equal_s(":", spec.string); + cl_assert_equal_s("", spec.src); + cl_assert_equal_s("", spec.dst); + + git_refspec__free(&spec); +} diff -Nru libgit2-0.22.2/tests/network/remote/defaultbranch.c libgit2-0.23.1/tests/network/remote/defaultbranch.c --- libgit2-0.22.2/tests/network/remote/defaultbranch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/network/remote/defaultbranch.c 2015-08-03 18:07:35.000000000 +0000 @@ -26,7 +26,7 @@ { git_buf name = GIT_BUF_INIT; - cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL)); cl_git_pass(git_remote_default_branch(&name, g_remote)); cl_assert_equal_s(should, name.ptr); git_buf_free(&name); @@ -39,13 +39,13 @@ void test_network_remote_defaultbranch__master_does_not_win(void) { - cl_git_pass(git_repository_set_head(g_repo_a, "refs/heads/not-good", NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo_a, "refs/heads/not-good")); assert_default_branch("refs/heads/not-good"); } void test_network_remote_defaultbranch__master_on_detached(void) { - cl_git_pass(git_repository_detach_head(g_repo_a, NULL, NULL)); + cl_git_pass(git_repository_detach_head(g_repo_a)); assert_default_branch("refs/heads/master"); } @@ -57,7 +57,7 @@ git_buf buf = GIT_BUF_INIT; cl_git_pass(git_remote_create(&remote_b, g_repo_b, "self", git_repository_path(g_repo_b))); - cl_git_pass(git_remote_connect(remote_b, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_connect(remote_b, GIT_DIRECTION_FETCH, NULL)); cl_git_pass(git_remote_ls(&heads, &len, remote_b)); cl_assert_equal_i(0, len); @@ -74,13 +74,13 @@ git_repository *cloned_repo; cl_git_pass(git_reference_name_to_id(&id, g_repo_a, "HEAD")); - cl_git_pass(git_repository_detach_head(g_repo_a, NULL, NULL)); + cl_git_pass(git_repository_detach_head(g_repo_a)); cl_git_pass(git_reference_remove(g_repo_a, "refs/heads/master")); cl_git_pass(git_reference_remove(g_repo_a, "refs/heads/not-good")); - cl_git_pass(git_reference_create(&ref, g_repo_a, "refs/foo/bar", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo_a, "refs/foo/bar", &id, 1, NULL)); git_reference_free(ref); - cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL)); cl_git_fail_with(GIT_ENOTFOUND, git_remote_default_branch(&buf, g_remote)); cl_git_pass(git_clone(&cloned_repo, git_repository_path(g_repo_a), "./local-detached", NULL)); @@ -97,7 +97,7 @@ git_reference *ref; git_repository *cloned_repo; - cl_git_pass(git_reference_symbolic_create(&ref, g_repo_a, "HEAD", "refs/heads/i-dont-exist", 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo_a, "HEAD", "refs/heads/i-dont-exist", 1, NULL)); git_reference_free(ref); cl_git_pass(git_clone(&cloned_repo, git_repository_path(g_repo_a), "./semi-empty", NULL)); diff -Nru libgit2-0.22.2/tests/network/remote/local.c libgit2-0.23.1/tests/network/remote/local.c --- libgit2-0.22.2/tests/network/remote/local.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/network/remote/local.c 2015-08-03 18:07:35.000000000 +0000 @@ -18,6 +18,7 @@ void test_network_remote_local__initialize(void) { cl_git_pass(git_repository_init(&repo, "remotelocal/", 0)); + cl_git_pass(git_repository_set_ident(repo, "Foo Bar", "foo@example.com")); cl_assert(repo != NULL); } @@ -38,8 +39,8 @@ { git_buf_sets(&file_path_buf, cl_git_path_url(local_repository)); - cl_git_pass(git_remote_create_anonymous(&remote, repo, git_buf_cstr(&file_path_buf), NULL)); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_create_anonymous(&remote, repo, git_buf_cstr(&file_path_buf))); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); } void test_network_remote_local__connected(void) @@ -70,7 +71,7 @@ git_buf_sets(&file_path_buf, cl_git_path_url(cl_fixture("testrepo.git"))); - cl_git_pass(git_remote_create_anonymous(&remote, repo, git_buf_cstr(&file_path_buf), NULL)); + cl_git_pass(git_remote_create_anonymous(&remote, repo, git_buf_cstr(&file_path_buf))); cl_git_fail(git_remote_ls(&refs, &refs_len, remote)); } @@ -137,8 +138,7 @@ connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_download(remote, &array)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); + cl_git_pass(git_remote_fetch(remote, &array, NULL, NULL)); cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/sloppy/master")); git_reference_free(ref); @@ -161,31 +161,29 @@ git_reference *ref; connect_to_local_repository(cl_fixture("testrepo.git")); - git_remote_clear_refspecs(remote); - - cl_git_pass(git_remote_download(remote, &array)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - cl_git_fail(git_reference_lookup(&ref, repo, "refs/remotes/master")); + cl_git_pass(git_remote_fetch(remote, &array, NULL, NULL)); + cl_git_fail(git_reference_lookup(&ref, repo, "refs/remotes/origin/master")); cl_git_fail(git_reference_lookup(&ref, repo, "refs/tags/hard_tag")); } void test_network_remote_local__tagopt(void) { git_reference *ref; + git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; cl_git_pass(git_remote_create(&remote, repo, "tagopt", cl_git_path_url(cl_fixture("testrepo.git")))); - git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_ALL); - cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); + fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_ALL; + cl_git_pass(git_remote_fetch(remote, NULL, &fetch_opts, NULL)); cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/tagopt/master")); git_reference_free(ref); cl_git_pass(git_reference_lookup(&ref, repo, "refs/tags/hard_tag")); git_reference_free(ref); - git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO); - cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); + fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO; + cl_git_pass(git_remote_fetch(remote, NULL, &fetch_opts, NULL)); cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/tagopt/master")); git_reference_free(ref); } @@ -205,9 +203,7 @@ /* Get some commits */ connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_download(remote, &array)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - git_remote_disconnect(remote); + cl_git_pass(git_remote_fetch(remote, &array, NULL, NULL)); /* Set up an empty bare repo to push into */ { @@ -217,11 +213,11 @@ } /* Connect to the bare repo */ - cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localbare.git", NULL)); - cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH)); + cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localbare.git")); + cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL)); /* Try to push */ - cl_git_pass(git_remote_upload(remote, &push_array, NULL)); + cl_git_pass(git_remote_upload(localremote, &push_array, NULL)); /* Clean up */ git_remote_free(localremote); @@ -243,9 +239,7 @@ /* Get some commits */ connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_download(remote, &array)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - git_remote_disconnect(remote); + cl_git_pass(git_remote_fetch(remote, &array, NULL, NULL)); /* Set up an empty bare repo to push into */ { @@ -258,11 +252,11 @@ url = cl_git_path_url("./localbare.git"); /* Connect to the bare repo */ - cl_git_pass(git_remote_create_anonymous(&localremote, repo, url, NULL)); - cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH)); + cl_git_pass(git_remote_create_anonymous(&localremote, repo, url)); + cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL)); /* Try to push */ - cl_git_pass(git_remote_upload(remote, &push_array, NULL)); + cl_git_pass(git_remote_upload(localremote, &push_array, NULL)); /* Clean up */ git_remote_free(localremote); @@ -281,12 +275,11 @@ }; /* Shouldn't be able to push to a non-bare remote */ git_remote *localremote; + git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; /* Get some commits */ connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_download(remote, &array)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - git_remote_disconnect(remote); + cl_git_pass(git_remote_fetch(remote, &array, &fetch_opts, NULL)); /* Set up an empty non-bare repo to push into */ { @@ -296,8 +289,8 @@ } /* Connect to the bare repo */ - cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localnonbare", NULL)); - cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH)); + cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localnonbare")); + cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL)); /* Try to push */ cl_git_fail_with(GIT_EBAREREPO, git_remote_upload(localremote, &push_array, NULL)); @@ -319,14 +312,11 @@ git_reflog *log; const git_reflog_entry *entry; - git_signature *sig; git_reference *ref; - cl_git_pass(git_signature_now(&sig, "Foo Bar", "foo@example.com")); - connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_fetch(remote, &array, sig, "UPDAAAAAATE!!")); + cl_git_pass(git_remote_fetch(remote, &array, NULL, "UPDAAAAAATE!!")); cl_git_pass(git_reference_lookup(&ref, repo, "refs/remotes/sloppy/master")); git_reference_free(ref); @@ -338,7 +328,6 @@ cl_assert_equal_s("UPDAAAAAATE!!", git_reflog_entry_message(entry)); git_reflog_free(log); - git_signature_free(sig); } void test_network_remote_local__reflog(void) @@ -353,14 +342,10 @@ git_reflog *log; const git_reflog_entry *entry; - git_signature *sig; - - cl_git_pass(git_signature_now(&sig, "Foo Bar", "foo@example.com")); connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_download(remote, &array)); - cl_git_pass(git_remote_update_tips(remote, sig, "UPDAAAAAATE!!")); + cl_git_pass(git_remote_fetch(remote, &array, NULL, "UPDAAAAAATE!!")); cl_git_pass(git_reflog_read(&log, repo, "refs/remotes/sloppy/master")); cl_assert_equal_i(1, git_reflog_entrycount(log)); @@ -369,7 +354,6 @@ cl_assert_equal_s("UPDAAAAAATE!!", git_reflog_entry_message(entry)); git_reflog_free(log); - git_signature_free(sig); } void test_network_remote_local__fetch_default_reflog_message(void) @@ -384,14 +368,11 @@ git_reflog *log; const git_reflog_entry *entry; - git_signature *sig; char expected_reflog_msg[1024]; - cl_git_pass(git_signature_now(&sig, "Foo Bar", "foo@example.com")); - connect_to_local_repository(cl_fixture("testrepo.git")); - cl_git_pass(git_remote_fetch(remote, &array, sig, NULL)); + cl_git_pass(git_remote_fetch(remote, &array, NULL, NULL)); cl_git_pass(git_reflog_read(&log, repo, "refs/remotes/sloppy/master")); cl_assert_equal_i(1, git_reflog_entrycount(log)); @@ -402,7 +383,6 @@ cl_assert_equal_s(expected_reflog_msg, git_reflog_entry_message(entry)); git_reflog_free(log); - git_signature_free(sig); } void test_network_remote_local__opportunistic_update(void) @@ -441,11 +421,8 @@ /* Push to bare repo */ cl_git_pass(git_remote_create(&new_remote, src_repo, "bare", "./localbare.git")); - cl_git_pass(git_remote_connect(new_remote, GIT_DIRECTION_PUSH)); - cl_git_pass(git_remote_upload(new_remote, &push_array, NULL)); - - /* Update tips and make sure remote branch has been created */ - cl_git_pass(git_remote_update_tips(new_remote, NULL, NULL)); + cl_git_pass(git_remote_push(new_remote, &push_array, NULL)); + /* Make sure remote branch has been created */ cl_git_pass(git_branch_lookup(&branch, src_repo, "bare/master", GIT_BRANCH_REMOTE)); git_reference_free(branch); @@ -475,12 +452,12 @@ cl_git_pass(git_remote_create(&remote, src_repo, "origin", "./target.git")); /* Push the master branch and verify it's there */ - cl_git_pass(git_remote_push(remote, &specs, NULL, NULL, NULL)); + cl_git_pass(git_remote_push(remote, &specs, NULL)); cl_git_pass(git_reference_lookup(&ref, dst_repo, "refs/heads/master")); git_reference_free(ref); specs.strings = spec_delete; - cl_git_pass(git_remote_push(remote, &specs, NULL, NULL, NULL)); + cl_git_pass(git_remote_push(remote, &specs, NULL)); cl_git_fail(git_reference_lookup(&ref, dst_repo, "refs/heads/master")); git_remote_free(remote); diff -Nru libgit2-0.22.2/tests/network/remote/push.c libgit2-0.23.1/tests/network/remote/push.c --- libgit2-0.22.2/tests/network/remote/push.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/network/remote/push.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,114 @@ +#include "clar_libgit2.h" +#include "git2/sys/commit.h" + +static git_remote *_remote; +static git_repository *_repo, *_dummy; + +void test_network_remote_push__initialize(void) +{ + cl_fixture_sandbox("testrepo.git"); + git_repository_open(&_repo, "testrepo.git"); + + /* We need a repository to have a remote */ + cl_git_pass(git_repository_init(&_dummy, "dummy.git", true)); + cl_git_pass(git_remote_create(&_remote, _dummy, "origin", cl_git_path_url("testrepo.git"))); +} + +void test_network_remote_push__cleanup(void) +{ + git_remote_free(_remote); + _remote = NULL; + + git_repository_free(_repo); + _repo = NULL; + + git_repository_free(_dummy); + _dummy = NULL; + + cl_fixture_cleanup("testrepo.git"); + cl_fixture_cleanup("dummy.git"); +} + +int negotiation_cb(const git_push_update **updates, size_t len, void *payload) +{ + const git_push_update *expected = payload; + + cl_assert_equal_i(1, len); + cl_assert_equal_s(expected->src_refname, updates[0]->src_refname); + cl_assert_equal_s(expected->dst_refname, updates[0]->dst_refname); + cl_assert_equal_oid(&expected->src, &updates[0]->src); + cl_assert_equal_oid(&expected->dst, &updates[0]->dst); + + return 0; +} + +void test_network_remote_push__delete_notification(void) +{ + git_push_options opts = GIT_PUSH_OPTIONS_INIT; + git_reference *ref; + git_push_update expected; + char *refspec = ":refs/heads/master"; + const git_strarray refspecs = { + &refspec, + 1, + }; + + cl_git_pass(git_reference_lookup(&ref, _repo, "refs/heads/master")); + + expected.src_refname = ""; + expected.dst_refname = "refs/heads/master"; + memset(&expected.dst, 0, sizeof(git_oid)); + git_oid_cpy(&expected.src, git_reference_target(ref)); + + opts.callbacks.push_negotiation = negotiation_cb; + opts.callbacks.payload = &expected; + cl_git_pass(git_remote_push(_remote, &refspecs, &opts)); + + git_reference_free(ref); + cl_git_fail_with(GIT_ENOTFOUND, git_reference_lookup(&ref, _repo, "refs/heads/master")); + +} + +void create_dummy_commit(git_reference **out, git_repository *repo) +{ + git_index *index; + git_oid tree_id, commit_id; + git_signature *sig; + + cl_git_pass(git_repository_index(&index, repo)); + cl_git_pass(git_index_write_tree(&tree_id, index)); + git_index_free(index); + + cl_git_pass(git_signature_now(&sig, "Pusher Joe", "pjoe")); + cl_git_pass(git_commit_create_from_ids(&commit_id, repo, NULL, sig, sig, + NULL, "Empty tree\n", &tree_id, 0, NULL)); + cl_git_pass(git_reference_create(out, repo, "refs/heads/empty-tree", &commit_id, true, "commit yo")); + git_signature_free(sig); +} + +void test_network_remote_push__create_notification(void) +{ + git_push_options opts = GIT_PUSH_OPTIONS_INIT; + git_reference *ref; + git_push_update expected; + char *refspec = "refs/heads/empty-tree"; + const git_strarray refspecs = { + &refspec, + 1, + }; + + create_dummy_commit(&ref, _dummy); + + expected.src_refname = "refs/heads/empty-tree"; + expected.dst_refname = "refs/heads/empty-tree"; + git_oid_cpy(&expected.dst, git_reference_target(ref)); + memset(&expected.src, 0, sizeof(git_oid)); + + opts.callbacks.push_negotiation = negotiation_cb; + opts.callbacks.payload = &expected; + cl_git_pass(git_remote_push(_remote, &refspecs, &opts)); + + git_reference_free(ref); + cl_git_pass(git_reference_lookup(&ref, _repo, "refs/heads/empty-tree")); + git_reference_free(ref); +} diff -Nru libgit2-0.22.2/tests/network/remote/remotes.c libgit2-0.23.1/tests/network/remote/remotes.c --- libgit2-0.22.2/tests/network/remote/remotes.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/network/remote/remotes.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,4 +1,5 @@ #include "clar_libgit2.h" +#include "config/config_helpers.h" #include "buffer.h" #include "refspec.h" #include "remote.h" @@ -53,11 +54,18 @@ void test_network_remote_remotes__pushurl(void) { - cl_git_pass(git_remote_set_pushurl(_remote, "git://github.com/libgit2/notlibgit2")); - cl_assert_equal_s(git_remote_pushurl(_remote), "git://github.com/libgit2/notlibgit2"); + const char *name = git_remote_name(_remote); + git_remote *mod; - cl_git_pass(git_remote_set_pushurl(_remote, NULL)); - cl_assert(git_remote_pushurl(_remote) == NULL); + cl_git_pass(git_remote_set_pushurl(_repo, name, "git://github.com/libgit2/notlibgit2")); + cl_git_pass(git_remote_lookup(&mod, _repo, name)); + cl_assert_equal_s(git_remote_pushurl(mod), "git://github.com/libgit2/notlibgit2"); + git_remote_free(mod); + + cl_git_pass(git_remote_set_pushurl(_repo, name, NULL)); + cl_git_pass(git_remote_lookup(&mod, _repo, name)); + cl_assert(git_remote_pushurl(mod) == NULL); + git_remote_free(mod); } void test_network_remote_remotes__error_when_not_found(void) @@ -72,6 +80,7 @@ void test_network_remote_remotes__error_when_no_push_available(void) { git_remote *r; + git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; char *specs = { "refs/heads/master", }; @@ -81,11 +90,10 @@ }; - cl_git_pass(git_remote_create_anonymous(&r, _repo, cl_fixture("testrepo.git"), NULL)); - - cl_git_pass(git_remote_set_transport(r, git_transport_local, NULL)); + cl_git_pass(git_remote_create_anonymous(&r, _repo, cl_fixture("testrepo.git"))); - cl_git_pass(git_remote_connect(r, GIT_DIRECTION_PUSH)); + callbacks.transport = git_transport_local; + cl_git_pass(git_remote_connect(r, GIT_DIRECTION_PUSH, &callbacks)); /* Make sure that push is really not available */ r->transport->push = NULL; @@ -107,9 +115,12 @@ size = git_remote_refspec_count(_remote); - cl_git_pass(git_remote_add_fetch(_remote, "refs/*:refs/*")); - + cl_git_pass(git_remote_add_fetch(_repo, "test", "refs/*:refs/*")); size++; + + git_remote_free(_remote); + cl_git_pass(git_remote_lookup(&_remote, _repo, "test")); + cl_assert_equal_i((int)size, (int)git_remote_refspec_count(_remote)); _refspec = git_remote_get_refspec(_remote, size - 1); @@ -117,6 +128,8 @@ cl_assert_equal_s(git_refspec_dst(_refspec), "refs/*"); cl_assert_equal_s(git_refspec_string(_refspec), "refs/*:refs/*"); cl_assert_equal_b(_refspec->push, false); + + cl_git_fail_with(GIT_EINVALIDSPEC, git_remote_add_fetch(_repo, "test", "refs/*/foo/*:refs/*")); } void test_network_remote_remotes__dup(void) @@ -148,8 +161,12 @@ size = git_remote_refspec_count(_remote); - cl_git_pass(git_remote_add_push(_remote, "refs/*:refs/*")); + cl_git_pass(git_remote_add_push(_repo, "test", "refs/*:refs/*")); size++; + + git_remote_free(_remote); + cl_git_pass(git_remote_lookup(&_remote, _repo, "test")); + cl_assert_equal_i((int)size, (int)git_remote_refspec_count(_remote)); _refspec = git_remote_get_refspec(_remote, size - 1); @@ -160,58 +177,6 @@ cl_assert_equal_b(_refspec->push, true); } -void test_network_remote_remotes__save(void) -{ - git_strarray array; - const char *fetch_refspec1 = "refs/heads/ns1/*:refs/remotes/upstream/ns1/*"; - const char *fetch_refspec2 = "refs/heads/ns2/*:refs/remotes/upstream/ns2/*"; - const char *push_refspec1 = "refs/heads/ns1/*:refs/heads/ns1/*"; - const char *push_refspec2 = "refs/heads/ns2/*:refs/heads/ns2/*"; - - git_remote_free(_remote); - _remote = NULL; - - /* Set up the remote and save it to config */ - cl_git_pass(git_remote_create(&_remote, _repo, "upstream", "git://github.com/libgit2/libgit2")); - git_remote_clear_refspecs(_remote); - - cl_git_pass(git_remote_add_fetch(_remote, fetch_refspec1)); - cl_git_pass(git_remote_add_fetch(_remote, fetch_refspec2)); - cl_git_pass(git_remote_add_push(_remote, push_refspec1)); - cl_git_pass(git_remote_add_push(_remote, push_refspec2)); - cl_git_pass(git_remote_set_pushurl(_remote, "git://github.com/libgit2/libgit2_push")); - cl_git_pass(git_remote_save(_remote)); - git_remote_free(_remote); - _remote = NULL; - - /* Load it from config and make sure everything matches */ - cl_git_pass(git_remote_lookup(&_remote, _repo, "upstream")); - - cl_git_pass(git_remote_get_fetch_refspecs(&array, _remote)); - cl_assert_equal_i(2, (int)array.count); - cl_assert_equal_s(fetch_refspec1, array.strings[0]); - cl_assert_equal_s(fetch_refspec2, array.strings[1]); - git_strarray_free(&array); - - cl_git_pass(git_remote_get_push_refspecs(&array, _remote)); - cl_assert_equal_i(2, (int)array.count); - cl_assert_equal_s(push_refspec1, array.strings[0]); - cl_assert_equal_s(push_refspec2, array.strings[1]); - git_strarray_free(&array); - - cl_assert_equal_s(git_remote_url(_remote), "git://github.com/libgit2/libgit2"); - cl_assert_equal_s(git_remote_pushurl(_remote), "git://github.com/libgit2/libgit2_push"); - - /* remove the pushurl again and see if we can save that too */ - cl_git_pass(git_remote_set_pushurl(_remote, NULL)); - cl_git_pass(git_remote_save(_remote)); - git_remote_free(_remote); - _remote = NULL; - - cl_git_pass(git_remote_lookup(&_remote, _repo, "upstream")); - cl_assert(git_remote_pushurl(_remote) == NULL); -} - void test_network_remote_remotes__fnmatch(void) { cl_assert(git_refspec_src_matches(_refspec, "refs/heads/master")); @@ -356,18 +321,6 @@ git_remote_create(&remote, _repo, NULL, "git://github.com/libgit2/libgit2")); } -void test_network_remote_remotes__cannot_save_an_inmemory_remote(void) -{ - git_remote *remote; - - cl_git_pass(git_remote_create_anonymous(&remote, _repo, "git://github.com/libgit2/libgit2", NULL)); - - cl_assert_equal_p(NULL, git_remote_name(remote)); - - cl_git_fail(git_remote_save(remote)); - git_remote_free(remote); -} - void test_network_remote_remotes__cannot_add_a_remote_with_an_invalid_name(void) { git_remote *remote = NULL; @@ -385,26 +338,16 @@ void test_network_remote_remotes__tagopt(void) { - const char *opt; - git_config *cfg; + const char *name = git_remote_name(_remote); - cl_git_pass(git_repository_config(&cfg, _repo)); + git_remote_set_autotag(_repo, name, GIT_REMOTE_DOWNLOAD_TAGS_ALL); + assert_config_entry_value(_repo, "remote.test.tagopt", "--tags"); - git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_ALL); - cl_git_pass(git_remote_save(_remote)); - cl_git_pass(git_config_get_string(&opt, cfg, "remote.test.tagopt")); - cl_assert_equal_s("--tags", opt); - - git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_NONE); - cl_git_pass(git_remote_save(_remote)); - cl_git_pass(git_config_get_string(&opt, cfg, "remote.test.tagopt")); - cl_assert_equal_s("--no-tags", opt); - - git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO); - cl_git_pass(git_remote_save(_remote)); - cl_assert(git_config_get_string(&opt, cfg, "remote.test.tagopt") == GIT_ENOTFOUND); + git_remote_set_autotag(_repo, name, GIT_REMOTE_DOWNLOAD_TAGS_NONE); + assert_config_entry_value(_repo, "remote.test.tagopt", "--no-tags"); - git_config_free(cfg); + git_remote_set_autotag(_repo, name, GIT_REMOTE_DOWNLOAD_TAGS_AUTO); + assert_config_entry_existence(_repo, "remote.test.tagopt", false); } void test_network_remote_remotes__can_load_with_an_empty_url(void) @@ -416,7 +359,7 @@ cl_assert(remote->url == NULL); cl_assert(remote->pushurl == NULL); - cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH)); + cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); cl_assert(giterr_last() != NULL); cl_assert(giterr_last()->klass == GITERR_INVALID); @@ -433,7 +376,7 @@ cl_assert(remote->url == NULL); cl_assert(remote->pushurl == NULL); - cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH)); + cl_git_fail(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); git_remote_free(remote); } @@ -499,13 +442,16 @@ git_strarray array; int i; - cl_git_pass(git_remote_create_anonymous(&remote, _repo, "git://github.com/libgit2/libgit2", NULL)); + cl_git_pass(git_remote_create_with_fetchspec(&remote, _repo, "query", "git://github.com/libgit2/libgit2", NULL)); + git_remote_free(remote); for (i = 0; i < 3; i++) { - cl_git_pass(git_remote_add_fetch(remote, fetch_refspecs[i])); - cl_git_pass(git_remote_add_push(remote, push_refspecs[i])); + cl_git_pass(git_remote_add_fetch(_repo, "query", fetch_refspecs[i])); + cl_git_pass(git_remote_add_push(_repo, "query", push_refspecs[i])); } + cl_git_pass(git_remote_lookup(&remote, _repo, "query")); + cl_git_pass(git_remote_get_fetch_refspecs(&array, remote)); for (i = 0; i < 3; i++) { cl_assert_equal_s(fetch_refspecs[i], array.strings[i]); @@ -519,65 +465,5 @@ git_strarray_free(&array); git_remote_free(remote); -} - -static int remote_single_branch(git_remote **out, git_repository *repo, const char *name, const char *url, void *payload) -{ - char *fetch_refspecs[] = { - "refs/heads/first-merge:refs/remotes/origin/first-merge", - }; - git_strarray fetch_refspecs_strarray = { - fetch_refspecs, - 1, - }; - - GIT_UNUSED(payload); - - cl_git_pass(git_remote_create(out, repo, name, url)); - cl_git_pass(git_remote_set_fetch_refspecs(*out, &fetch_refspecs_strarray)); - - return 0; -} - -void test_network_remote_remotes__fetch_from_anonymous(void) -{ - git_remote *remote; - - cl_git_pass(git_remote_create_anonymous(&remote, _repo, cl_fixture("testrepo.git"), - "refs/heads/*:refs/other/*")); - cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL)); - git_remote_free(remote); -} - -void test_network_remote_remotes__single_branch(void) -{ - git_clone_options opts = GIT_CLONE_OPTIONS_INIT; - git_repository *repo; - git_strarray refs; - size_t i, count = 0; - - opts.remote_cb = remote_single_branch; - opts.checkout_branch = "first-merge"; - - cl_git_pass(git_clone(&repo, "git://github.com/libgit2/TestGitRepository", "./single-branch", &opts)); - cl_git_pass(git_reference_list(&refs, repo)); - - for (i = 0; i < refs.count; i++) { - if (!git__prefixcmp(refs.strings[i], "refs/heads/")) - count++; - } - cl_assert_equal_i(1, count); - - git_strarray_free(&refs); - git_repository_free(repo); -} - -void test_network_remote_remotes__restricted_refspecs(void) -{ - git_clone_options opts = GIT_CLONE_OPTIONS_INIT; - git_repository *repo; - - opts.remote_cb = remote_single_branch; - - cl_git_fail_with(GIT_EINVALIDSPEC, git_clone(&repo, "git://github.com/libgit2/TestGitRepository", "./restrict-refspec", &opts)); + git_remote_delete(_repo, "test"); } diff -Nru libgit2-0.22.2/tests/network/remote/rename.c libgit2-0.23.1/tests/network/remote/rename.c --- libgit2-0.22.2/tests/network/remote/rename.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/network/remote/rename.c 2015-08-03 18:07:35.000000000 +0000 @@ -181,7 +181,7 @@ git_strarray problems = {0}; cl_git_pass(git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750")); - cl_git_pass(git_reference_create(&ref, _repo, "refs/remotes/renamed/master", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, _repo, "refs/remotes/renamed/master", &id, 1, NULL)); git_reference_free(ref); cl_git_pass(git_remote_rename(&problems, _repo, _remote_name, "renamed")); @@ -219,7 +219,7 @@ char idstr[GIT_OID_HEXSZ + 1] = {0}; git_vector refs; - cl_git_pass(git_reference_symbolic_create(&ref, _repo, "refs/remotes/test/HEAD", "refs/remotes/test/master", 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, _repo, "refs/remotes/test/HEAD", "refs/remotes/test/master", 0, NULL)); git_reference_free(ref); cl_git_pass(git_remote_rename(&problems, _repo, _remote_name, "renamed")); diff -Nru libgit2-0.22.2/tests/notes/notes.c libgit2-0.23.1/tests/notes/notes.c --- libgit2-0.22.2/tests/notes/notes.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/notes/notes.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,5 +1,7 @@ #include "clar_libgit2.h" +#include "buffer.h" + static git_repository *_repo; static git_signature *_sig; @@ -150,7 +152,7 @@ { git_oid note_oid, target_oid; git_note *note, *default_namespace_note; - const char *default_ref; + git_buf default_ref = GIT_BUF_INIT; cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125")); cl_git_pass(git_note_default_ref(&default_ref, _repo)); @@ -158,11 +160,12 @@ create_note(¬e_oid, NULL, "08b041783f40edfe12bb406c9c9a8a040177c125", "hello world\n"); cl_git_pass(git_note_read(¬e, _repo, NULL, &target_oid)); - cl_git_pass(git_note_read(&default_namespace_note, _repo, default_ref, &target_oid)); + cl_git_pass(git_note_read(&default_namespace_note, _repo, git_buf_cstr(&default_ref), &target_oid)); assert_note_equal(note, "hello world\n", ¬e_oid); assert_note_equal(default_namespace_note, "hello world\n", ¬e_oid); + git_buf_free(&default_ref); git_note_free(note); git_note_free(default_namespace_note); } diff -Nru libgit2-0.22.2/tests/notes/notesref.c libgit2-0.23.1/tests/notes/notesref.c --- libgit2-0.22.2/tests/notes/notesref.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/notes/notesref.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,6 +1,7 @@ #include "clar_libgit2.h" #include "notes.h" +#include "buffer.h" static git_repository *_repo; static git_note *_note; @@ -33,7 +34,7 @@ void test_notes_notesref__config_corenotesref(void) { git_oid oid, note_oid; - const char *default_ref; + git_buf default_ref = GIT_BUF_INIT; cl_git_pass(git_signature_now(&_sig, "alice", "alice@example.com")); cl_git_pass(git_oid_fromstr(&oid, "8496071c1b46c854b31185ea97743be6a8774479")); @@ -55,10 +56,13 @@ cl_assert_equal_oid(git_note_id(_note), ¬e_oid); cl_git_pass(git_note_default_ref(&default_ref, _repo)); - cl_assert_equal_s("refs/notes/mydefaultnotesref", default_ref); + cl_assert_equal_s("refs/notes/mydefaultnotesref", default_ref.ptr); + git_buf_clear(&default_ref); cl_git_pass(git_config_delete_entry(_cfg, "core.notesRef")); cl_git_pass(git_note_default_ref(&default_ref, _repo)); - cl_assert_equal_s(GIT_NOTES_DEFAULT_REF, default_ref); + cl_assert_equal_s(GIT_NOTES_DEFAULT_REF, default_ref.ptr); + + git_buf_free(&default_ref); } diff -Nru libgit2-0.22.2/tests/object/tree/duplicateentries.c libgit2-0.23.1/tests/object/tree/duplicateentries.c --- libgit2-0.22.2/tests/object/tree/duplicateentries.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/object/tree/duplicateentries.c 2015-08-03 18:07:35.000000000 +0000 @@ -126,17 +126,17 @@ ancestor_entry.path = "duplicate"; ancestor_entry.mode = GIT_FILEMODE_BLOB; - ancestor_entry.flags |= (1 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1); git_oid_fromstr(&ancestor_entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6"); our_entry.path = "duplicate"; our_entry.mode = GIT_FILEMODE_BLOB; - ancestor_entry.flags |= (2 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&our_entry, 2); git_oid_fromstr(&our_entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057"); their_entry.path = "duplicate"; their_entry.mode = GIT_FILEMODE_BLOB; - ancestor_entry.flags |= (3 << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&their_entry, 3); git_oid_fromstr(&their_entry.id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd"); cl_git_pass(git_index_conflict_add(index, &ancestor_entry, &our_entry, &their_entry)); diff -Nru libgit2-0.22.2/tests/odb/foreach.c libgit2-0.23.1/tests/odb/foreach.c --- libgit2-0.22.2/tests/odb/foreach.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/odb/foreach.c 2015-08-03 18:07:35.000000000 +0000 @@ -71,15 +71,35 @@ return (*nobj == 1000) ? -321 : 0; } +static int foreach_stop_first_cb(const git_oid *oid, void *data) +{ + int *nobj = data; + (*nobj)++; + + GIT_UNUSED(oid); + + return -123; +} + void test_odb_foreach__interrupt_foreach(void) { int nobj = 0; + git_oid id; cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git"))); git_repository_odb(&_odb, _repo); cl_assert_equal_i(-321, git_odb_foreach(_odb, foreach_stop_cb, &nobj)); cl_assert(nobj == 1000); + + git_odb_free(_odb); + git_repository_free(_repo); + + cl_git_pass(git_repository_init(&_repo, "onlyloose.git", true)); + git_repository_odb(&_odb, _repo); + + cl_git_pass(git_odb_write(&id, _odb, "", 0, GIT_OBJ_BLOB)); + cl_assert_equal_i(-123, git_odb_foreach(_odb, foreach_stop_first_cb, &nobj)); } void test_odb_foreach__files_in_objects_dir(void) diff -Nru libgit2-0.22.2/tests/online/clone.c libgit2-0.23.1/tests/online/clone.c --- libgit2-0.22.2/tests/online/clone.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/online/clone.c 2015-08-03 18:07:35.000000000 +0000 @@ -20,7 +20,7 @@ void test_online_clone__initialize(void) { git_checkout_options dummy_opts = GIT_CHECKOUT_OPTIONS_INIT; - git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options dummy_fetch = GIT_FETCH_OPTIONS_INIT; g_repo = NULL; @@ -28,7 +28,7 @@ g_options.version = GIT_CLONE_OPTIONS_VERSION; g_options.checkout_opts = dummy_opts; g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - g_options.remote_callbacks = dummy_callbacks; + g_options.fetch_opts = dummy_fetch; } void test_online_clone__cleanup(void) @@ -104,11 +104,11 @@ bool checkout_progress_cb_was_called = false, fetch_progress_cb_was_called = false; - g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + g_options.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; g_options.checkout_opts.progress_cb = &checkout_progress; g_options.checkout_opts.progress_payload = &checkout_progress_cb_was_called; - g_options.remote_callbacks.transfer_progress = &fetch_progress; - g_options.remote_callbacks.payload = &fetch_progress_cb_was_called; + g_options.fetch_opts.callbacks.transfer_progress = &fetch_progress; + g_options.fetch_opts.callbacks.payload = &fetch_progress_cb_was_called; cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); @@ -131,23 +131,11 @@ { int error; git_remote *remote; - git_remote_callbacks *callbacks = (git_remote_callbacks *) payload; - - - if ((error = git_remote_create(&remote, repo, name, url)) < 0) - return error; - - if ((error = git_remote_set_callbacks(remote, callbacks)) < 0) { - git_remote_free(remote); - return error; - } - git_remote_clear_refspecs(remote); + GIT_UNUSED(payload); - if ((error = git_remote_add_fetch(remote, "+refs/*:refs/*")) < 0) { - git_remote_free(remote); + if ((error = git_remote_create_with_fetchspec(&remote, repo, name, url, "+refs/*:refs/*")) < 0) return error; - } *out = remote; return 0; @@ -157,16 +145,14 @@ { git_clone_options opts = GIT_CLONE_OPTIONS_INIT; git_reference *head; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; bool fetch_progress_cb_was_called = false; - callbacks.transfer_progress = &fetch_progress; - callbacks.payload = &fetch_progress_cb_was_called; + opts.fetch_opts.callbacks.transfer_progress = &fetch_progress; + opts.fetch_opts.callbacks.payload = &fetch_progress_cb_was_called; opts.bare = true; opts.remote_cb = remote_mirror_cb; - opts.remote_cb_payload = &callbacks; cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo.git", &opts)); @@ -195,8 +181,8 @@ { int callcount = 0; - g_options.remote_callbacks.update_tips = update_tips; - g_options.remote_callbacks.payload = &callcount; + g_options.fetch_opts.callbacks.update_tips = update_tips; + g_options.fetch_opts.callbacks.payload = &callcount; cl_git_pass(git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options)); cl_assert(callcount > 0); @@ -222,7 +208,7 @@ if (!remote_url || !remote_user) clar__skip(); - g_options.remote_callbacks.credentials = cred_failure_cb; + g_options.fetch_opts.callbacks.credentials = cred_failure_cb; cl_git_fail_with(-172, git_clone(&g_repo, remote_url, "./foo", &g_options)); } @@ -254,8 +240,8 @@ if (!remote_url || !remote_user) clar__skip(); - g_options.remote_callbacks.credentials = cred_count_calls_cb; - g_options.remote_callbacks.payload = &counter; + g_options.fetch_opts.callbacks.credentials = cred_count_calls_cb; + g_options.fetch_opts.callbacks.payload = &counter; cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, remote_url, "./foo", &g_options)); cl_assert_equal_i(3, counter); @@ -292,10 +278,10 @@ if (!remote_url) return; if (cl_getenv("GITTEST_REMOTE_DEFAULT")) { - g_options.remote_callbacks.credentials = cred_default; + g_options.fetch_opts.callbacks.credentials = cred_default; } else { - g_options.remote_callbacks.credentials = git_cred_userpass; - g_options.remote_callbacks.payload = &user_pass; + g_options.fetch_opts.callbacks.credentials = git_cred_userpass; + g_options.fetch_opts.callbacks.payload = &user_pass; } cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options)); @@ -309,8 +295,8 @@ "libgit2", "libgit2" }; - g_options.remote_callbacks.credentials = git_cred_userpass; - g_options.remote_callbacks.payload = &user_pass; + g_options.fetch_opts.callbacks.credentials = git_cred_userpass; + g_options.fetch_opts.callbacks.payload = &user_pass; cl_git_pass(git_clone(&g_repo, BB_REPO_URL, "./foo", &g_options)); git_repository_free(g_repo); g_repo = NULL; @@ -340,7 +326,7 @@ void test_online_clone__can_cancel(void) { - g_options.remote_callbacks.transfer_progress = cancel_at_half; + g_options.fetch_opts.callbacks.transfer_progress = cancel_at_half; cl_git_fail_with( git_clone(&g_repo, LIVE_REPO_URL, "./foo", &g_options), 4321); @@ -387,8 +373,8 @@ #ifndef GIT_SSH clar__skip(); #endif - g_options.remote_callbacks.credentials = check_ssh_auth_methods; - g_options.remote_callbacks.payload = &with_user; + g_options.fetch_opts.callbacks.credentials = check_ssh_auth_methods; + g_options.fetch_opts.callbacks.payload = &with_user; with_user = 0; cl_git_fail_with(GIT_EUSER, @@ -407,17 +393,12 @@ void *payload) { int error; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; - if ((error = git_remote_create(out, repo, name, url)) < 0) - return error; + GIT_UNUSED(payload); - if ((error = git_remote_set_transport(*out, git_transport_ssh_with_paths, payload)) < 0) + if ((error = git_remote_create(out, repo, name, url)) < 0) return error; - callbacks.credentials = cred_cb; - git_remote_set_callbacks(*out, &callbacks); - return 0; } @@ -446,7 +427,9 @@ clar__skip(); g_options.remote_cb = custom_remote_ssh_with_paths; - g_options.remote_cb_payload = &arr; + g_options.fetch_opts.callbacks.transport = git_transport_ssh_with_paths; + g_options.fetch_opts.callbacks.credentials = cred_cb; + g_options.fetch_opts.callbacks.payload = &arr; cl_git_fail(git_clone(&g_repo, remote_url, "./foo", &g_options)); @@ -468,7 +451,7 @@ #ifndef GIT_SSH clar__skip(); #endif - g_options.remote_callbacks.credentials = cred_foo_bar; + g_options.fetch_opts.callbacks.credentials = cred_foo_bar; cl_git_fail(git_clone(&g_repo, "ssh://git@github.com/libgit2/TestGitRepository", "./foo", &g_options)); } @@ -511,7 +494,7 @@ void test_online_clone__ssh_cert(void) { - g_options.remote_callbacks.certificate_check = ssh_certificate_check; + g_options.fetch_opts.callbacks.certificate_check = ssh_certificate_check; if (!cl_getenv("GITTEST_REMOTE_SSH_FINGERPRINT")) cl_skip(); @@ -519,6 +502,74 @@ cl_git_fail_with(GIT_EUSER, git_clone(&g_repo, "ssh://localhost/foo", "./foo", &g_options)); } +static char *read_key_file(const char *path) +{ + FILE *f; + char *buf; + long key_length; + + if (!path || !*path) + return NULL; + + cl_assert((f = fopen(path, "r")) != NULL); + cl_assert(fseek(f, 0, SEEK_END) != -1); + cl_assert((key_length = ftell(f)) != -1); + cl_assert(fseek(f, 0, SEEK_SET) != -1); + cl_assert((buf = malloc(key_length)) != NULL); + cl_assert(fread(buf, key_length, 1, f) == 1); + fclose(f); + + return buf; +} + +static int ssh_memory_cred_cb(git_cred **cred, const char *url, const char *user_from_url, + unsigned int allowed_types, void *payload) +{ + const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); + const char *pubkey_path = cl_getenv("GITTEST_REMOTE_SSH_PUBKEY"); + const char *privkey_path = cl_getenv("GITTEST_REMOTE_SSH_KEY"); + const char *passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE"); + + GIT_UNUSED(url); GIT_UNUSED(user_from_url); GIT_UNUSED(payload); + + if (allowed_types & GIT_CREDTYPE_USERNAME) + return git_cred_username_new(cred, remote_user); + + if (allowed_types & GIT_CREDTYPE_SSH_KEY) + { + char *pubkey = read_key_file(pubkey_path); + char *privkey = read_key_file(privkey_path); + + int ret = git_cred_ssh_key_memory_new(cred, remote_user, pubkey, privkey, passphrase); + + if (privkey) + free(privkey); + if (pubkey) + free(pubkey); + return ret; + } + + giterr_set(GITERR_NET, "unexpected cred type"); + return -1; +} + +void test_online_clone__ssh_memory_auth(void) +{ + const char *remote_url = cl_getenv("GITTEST_REMOTE_URL"); + const char *remote_user = cl_getenv("GITTEST_REMOTE_USER"); + const char *privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY"); + +#ifndef GIT_SSH_MEMORY_CREDENTIALS + clar__skip(); +#endif + if (!remote_url || !remote_user || !privkey || strncmp(remote_url, "ssh://", 5) != 0) + clar__skip(); + + g_options.fetch_opts.callbacks.credentials = ssh_memory_cred_cb; + + cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options)); +} + void test_online_clone__url_with_no_path_returns_EINVALIDSPEC(void) { cl_git_fail_with(git_clone(&g_repo, "http://github.com", "./foo", &g_options), @@ -537,7 +588,7 @@ void test_online_clone__certificate_invalid(void) { - g_options.remote_callbacks.certificate_check = fail_certificate_check; + g_options.fetch_opts.callbacks.certificate_check = fail_certificate_check; cl_git_fail_with(git_clone(&g_repo, "https://github.com/libgit2/TestGitRepository", "./foo", &g_options), GIT_ECERTIFICATE); @@ -561,7 +612,14 @@ void test_online_clone__certificate_valid(void) { - g_options.remote_callbacks.certificate_check = succeed_certificate_check; + g_options.fetch_opts.callbacks.certificate_check = succeed_certificate_check; cl_git_pass(git_clone(&g_repo, "https://github.com/libgit2/TestGitRepository", "./foo", &g_options)); } + +void test_online_clone__start_with_http(void) +{ + g_options.fetch_opts.callbacks.certificate_check = succeed_certificate_check; + + cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options)); +} diff -Nru libgit2-0.22.2/tests/online/fetch.c libgit2-0.23.1/tests/online/fetch.c --- libgit2-0.22.2/tests/online/fetch.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/online/fetch.c 2015-08-03 18:07:35.000000000 +0000 @@ -35,21 +35,17 @@ static void do_fetch(const char *url, git_remote_autotag_option_t flag, int n) { git_remote *remote; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; size_t bytes_received = 0; - callbacks.transfer_progress = progress; - callbacks.update_tips = update_tips; - callbacks.payload = &bytes_received; + options.callbacks.transfer_progress = progress; + options.callbacks.update_tips = update_tips; + options.callbacks.payload = &bytes_received; + options.download_tags = flag; counter = 0; cl_git_pass(git_remote_create(&remote, _repo, "test", url)); - git_remote_set_callbacks(remote, &callbacks); - git_remote_set_autotag(remote, flag); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(remote, NULL)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - git_remote_disconnect(remote); + cl_git_pass(git_remote_fetch(remote, NULL, &options, NULL)); cl_assert_equal_i(counter, n); cl_assert(bytes_received > 0); @@ -85,12 +81,12 @@ { git_remote *remote; cl_git_pass(git_remote_create(&remote, _repo, "test", "git://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(remote, NULL)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_pass(git_remote_download(remote, NULL, NULL)); git_remote_disconnect(remote); - git_remote_connect(remote, GIT_DIRECTION_FETCH); - cl_git_pass(git_remote_download(remote, NULL)); + git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL); + cl_git_pass(git_remote_download(remote, NULL, NULL)); git_remote_disconnect(remote); git_remote_free(remote); @@ -110,7 +106,7 @@ git_repository *_repository; bool invoked = false; git_remote *remote; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; git_clone_options opts = GIT_CLONE_OPTIONS_INIT; opts.bare = true; @@ -121,18 +117,17 @@ cl_git_pass(git_repository_open(&_repository, "./fetch/lg2")); cl_git_pass(git_remote_lookup(&remote, _repository, "origin")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); cl_assert_equal_i(false, invoked); - callbacks.transfer_progress = &transferProgressCallback; - callbacks.payload = &invoked; - git_remote_set_callbacks(remote, &callbacks); - cl_git_pass(git_remote_download(remote, NULL)); + options.callbacks.transfer_progress = &transferProgressCallback; + options.callbacks.payload = &invoked; + cl_git_pass(git_remote_download(remote, NULL, &options)); cl_assert_equal_i(false, invoked); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); + cl_git_pass(git_remote_update_tips(remote, &options.callbacks, 1, options.download_tags, NULL)); git_remote_disconnect(remote); git_remote_free(remote); @@ -152,17 +147,16 @@ { git_remote *remote; size_t bytes_received = 0; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options options = GIT_FETCH_OPTIONS_INIT; cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); - callbacks.transfer_progress = cancel_at_half; - callbacks.payload = &bytes_received; - git_remote_set_callbacks(remote, &callbacks); + options.callbacks.transfer_progress = cancel_at_half; + options.callbacks.payload = &bytes_received; - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); - cl_git_fail_with(git_remote_download(remote, NULL), -4321); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); + cl_git_fail_with(git_remote_download(remote, NULL, &options), -4321); git_remote_disconnect(remote); git_remote_free(remote); } @@ -175,7 +169,7 @@ cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); cl_git_pass(git_remote_ls(&refs, &refs_len_before, remote)); git_remote_disconnect(remote); cl_git_pass(git_remote_ls(&refs, &refs_len_after, remote)); @@ -193,7 +187,7 @@ cl_git_pass(git_remote_create(&remote, _repo, "test", "http://github.com/libgit2/TestGitRepository.git")); - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); + cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH, NULL)); git_remote_disconnect(remote); cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); diff -Nru libgit2-0.22.2/tests/online/fetchhead.c libgit2-0.23.1/tests/online/fetchhead.c --- libgit2-0.22.2/tests/online/fetchhead.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/online/fetchhead.c 2015-08-03 18:07:35.000000000 +0000 @@ -12,12 +12,12 @@ void test_online_fetchhead__initialize(void) { - git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_fetch_options dummy_fetch = GIT_FETCH_OPTIONS_INIT; g_repo = NULL; memset(&g_options, 0, sizeof(git_clone_options)); g_options.version = GIT_CLONE_OPTIONS_VERSION; - g_options.remote_callbacks = dummy_callbacks; + g_options.fetch_opts = dummy_fetch; } void test_online_fetchhead__cleanup(void) @@ -38,12 +38,13 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fetchhead) { git_remote *remote; + git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; git_buf fetchhead_buf = GIT_BUF_INIT; int equals = 0; git_strarray array, *active_refs = NULL; cl_git_pass(git_remote_lookup(&remote, g_repo, "origin")); - git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO); + fetch_opts.download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO; if(fetchspec != NULL) { array.count = 1; @@ -51,10 +52,7 @@ active_refs = &array; } - cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(remote, active_refs)); - cl_git_pass(git_remote_update_tips(remote, NULL, NULL)); - git_remote_disconnect(remote); + cl_git_pass(git_remote_fetch(remote, active_refs, &fetch_opts, NULL)); git_remote_free(remote); cl_git_pass(git_futils_readbuffer(&fetchhead_buf, "./foo/.git/FETCH_HEAD")); diff -Nru libgit2-0.22.2/tests/online/push.c libgit2-0.23.1/tests/online/push.c --- libgit2-0.22.2/tests/online/push.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/online/push.c 2015-08-03 18:07:35.000000000 +0000 @@ -319,9 +319,12 @@ git_vector delete_specs = GIT_VECTOR_INIT; const git_remote_head **heads; size_t heads_len; + git_push_options push_opts = GIT_PUSH_OPTIONS_INIT; + git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT; _repo = cl_git_sandbox_init("push_src"); + cl_git_pass(git_repository_set_ident(_repo, "Random J. Hacker", "foo@example.com")); cl_fixture_sandbox("testrepo.git"); cl_rename("push_src/submodule/.gitted", "push_src/submodule/.git"); @@ -368,9 +371,8 @@ cl_git_pass(git_remote_create(&_remote, _repo, "test", _remote_url)); record_callbacks_data_clear(&_record_cbs_data); - git_remote_set_callbacks(_remote, &_record_cbs); - cl_git_pass(git_remote_connect(_remote, GIT_DIRECTION_PUSH)); + cl_git_pass(git_remote_connect(_remote, GIT_DIRECTION_PUSH, &_record_cbs)); /* Clean up previously pushed branches. Fails if receive.denyDeletes is * set on the remote. Also, on Git 1.7.0 and newer, you must run @@ -386,17 +388,16 @@ delete_specs.length, }; - cl_git_pass(git_remote_upload(_remote, &arr, NULL)); + memcpy(&push_opts.callbacks, &_record_cbs, sizeof(git_remote_callbacks)); + cl_git_pass(git_remote_upload(_remote, &arr, &push_opts)); } git_remote_disconnect(_remote); git_vector_free(&delete_specs); /* Now that we've deleted everything, fetch from the remote */ - cl_git_pass(git_remote_connect(_remote, GIT_DIRECTION_FETCH)); - cl_git_pass(git_remote_download(_remote, NULL)); - cl_git_pass(git_remote_update_tips(_remote, NULL, NULL)); - git_remote_disconnect(_remote); + memcpy(&fetch_opts.callbacks, &_record_cbs, sizeof(git_remote_callbacks)); + cl_git_pass(git_remote_fetch(_remote, NULL, &fetch_opts, NULL)); } void test_online_push__cleanup(void) @@ -458,23 +459,18 @@ size_t i; int error; git_strarray specs = {0}; - git_signature *pusher; - git_remote_callbacks callbacks; record_callbacks_data *data; if (_remote) { /* Auto-detect the number of threads to use */ opts.pb_parallelism = 0; - cl_git_pass(git_signature_now(&pusher, "Foo Bar", "foo@example.com")); - - memcpy(&callbacks, git_remote_get_callbacks(_remote), sizeof(callbacks)); - data = callbacks.payload; + memcpy(&opts.callbacks, &_record_cbs, sizeof(git_remote_callbacks)); + data = opts.callbacks.payload; - callbacks.pack_progress = push_pack_progress_cb; - callbacks.push_transfer_progress = push_transfer_progress_cb; - callbacks.push_update_reference = record_push_status_cb; - cl_git_pass(git_remote_set_callbacks(_remote, &callbacks)); + opts.callbacks.pack_progress = push_pack_progress_cb; + opts.callbacks.push_transfer_progress = push_transfer_progress_cb; + opts.callbacks.push_update_reference = record_push_status_cb; if (refspecs_len) { specs.count = refspecs_len; @@ -489,7 +485,7 @@ if (check_progress_cb && expected_ret == GIT_EUSER) data->transfer_progress_calls = GIT_EUSER; - error = git_remote_push(_remote, &specs, &opts, pusher, "test push"); + error = git_remote_push(_remote, &specs, &opts); git__free(specs.strings); if (expected_ret < 0) { @@ -511,7 +507,6 @@ if (check_update_tips_cb) verify_update_tips_callback(_remote, expected_refs, expected_refs_len); - git_signature_free(pusher); } } @@ -611,7 +606,7 @@ cl_git_pass(git_reflog_read(&log, _repo, "refs/remotes/test/b1")); entry = git_reflog_entry_byindex(log, 0); if (entry) { - cl_assert_equal_s("test push", git_reflog_entry_message(entry)); + cl_assert_equal_s("update by push", git_reflog_entry_message(entry)); cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); } @@ -870,6 +865,7 @@ { git_oid note_oid, *target_oid, expected_oid; git_signature *signature; + git_remote *old_remote; const char *specs[] = { "refs/notes/commits:refs/notes/commits" }; push_status exp_stats[] = { { "refs/notes/commits", 1 } }; expected_ref exp_refs[] = { { "refs/notes/commits", &expected_oid } }; @@ -879,7 +875,10 @@ target_oid = &_oid_b6; - cl_git_pass(git_remote_add_push(_remote, specs[0])); + cl_git_pass(git_remote_add_push(_repo, git_remote_name(_remote), specs[0])); + old_remote = _remote; + cl_git_pass(git_remote_lookup(&_remote, _repo, git_remote_name(_remote))); + git_remote_free(old_remote); /* Create note to push */ cl_git_pass(git_signature_new(&signature, "nulltoken", "emeric.fermas@gmail.com", 1323847743, 60)); /* Wed Dec 14 08:29:03 2011 +0100 */ diff -Nru libgit2-0.22.2/tests/online/push_util.h libgit2-0.23.1/tests/online/push_util.h --- libgit2-0.22.2/tests/online/push_util.h 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/online/push_util.h 2015-08-03 18:07:35.000000000 +0000 @@ -12,7 +12,7 @@ * @param data pointer to a record_callbacks_data instance */ #define RECORD_CALLBACKS_INIT(data) \ - { GIT_REMOTE_CALLBACKS_VERSION, NULL, NULL, cred_acquire_cb, NULL, NULL, record_update_tips_cb, NULL, NULL, NULL, data } + { GIT_REMOTE_CALLBACKS_VERSION, NULL, NULL, cred_acquire_cb, NULL, NULL, record_update_tips_cb, NULL, NULL, NULL, NULL, NULL, data } typedef struct { char *name; diff -Nru libgit2-0.22.2/tests/online/remotes.c libgit2-0.23.1/tests/online/remotes.c --- libgit2-0.22.2/tests/online/remotes.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/online/remotes.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,55 @@ +#include "clar_libgit2.h" + +static const char *refspec = "refs/heads/first-merge:refs/remotes/origin/first-merge"; + +static int remote_single_branch(git_remote **out, git_repository *repo, const char *name, const char *url, void *payload) +{ + GIT_UNUSED(payload); + + cl_git_pass(git_remote_create_with_fetchspec(out, repo, name, url, refspec)); + + return 0; +} + +void test_online_remotes__single_branch(void) +{ + git_clone_options opts = GIT_CLONE_OPTIONS_INIT; + git_repository *repo; + git_remote *remote; + git_strarray refs; + size_t i, count = 0; + + opts.remote_cb = remote_single_branch; + opts.checkout_branch = "first-merge"; + + cl_git_pass(git_clone(&repo, "git://github.com/libgit2/TestGitRepository", "./single-branch", &opts)); + cl_git_pass(git_reference_list(&refs, repo)); + + for (i = 0; i < refs.count; i++) { + if (!git__prefixcmp(refs.strings[i], "refs/heads/")) + count++; + } + cl_assert_equal_i(1, count); + + git_strarray_free(&refs); + + cl_git_pass(git_remote_lookup(&remote, repo, "origin")); + cl_git_pass(git_remote_get_fetch_refspecs(&refs, remote)); + + cl_assert_equal_i(1, refs.count); + cl_assert_equal_s(refspec, refs.strings[0]); + + git_strarray_free(&refs); + git_remote_free(remote); + git_repository_free(repo); +} + +void test_online_remotes__restricted_refspecs(void) +{ + git_clone_options opts = GIT_CLONE_OPTIONS_INIT; + git_repository *repo; + + opts.remote_cb = remote_single_branch; + + cl_git_fail_with(GIT_EINVALIDSPEC, git_clone(&repo, "git://github.com/libgit2/TestGitRepository", "./restrict-refspec", &opts)); +} diff -Nru libgit2-0.22.2/tests/perf/helper__perf__do_merge.c libgit2-0.23.1/tests/perf/helper__perf__do_merge.c --- libgit2-0.22.2/tests/perf/helper__perf__do_merge.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/perf/helper__perf__do_merge.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,75 @@ +#include "clar_libgit2.h" +#include "helper__perf__do_merge.h" +#include "helper__perf__timer.h" + +static git_repository * g_repo; + +void perf__do_merge(const char *fixture, + const char *test_name, + const char *id_a, + const char *id_b) +{ + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT; + git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT; + git_oid oid_a; + git_oid oid_b; + git_reference *ref_branch_a = NULL; + git_reference *ref_branch_b = NULL; + git_commit *commit_a = NULL; + git_commit *commit_b = NULL; + git_annotated_commit *annotated_commits[1] = { NULL }; + perf_timer t_total = PERF_TIMER_INIT; + perf_timer t_clone = PERF_TIMER_INIT; + perf_timer t_checkout = PERF_TIMER_INIT; + perf_timer t_merge = PERF_TIMER_INIT; + + perf__timer__start(&t_total); + + checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; + clone_opts.checkout_opts = checkout_opts; + + perf__timer__start(&t_clone); + cl_git_pass(git_clone(&g_repo, fixture, test_name, &clone_opts)); + perf__timer__stop(&t_clone); + + git_oid_fromstr(&oid_a, id_a); + cl_git_pass(git_commit_lookup(&commit_a, g_repo, &oid_a)); + cl_git_pass(git_branch_create(&ref_branch_a, g_repo, + "A", commit_a, + 0)); + + perf__timer__start(&t_checkout); + cl_git_pass(git_checkout_tree(g_repo, (git_object*)commit_a, &checkout_opts)); + perf__timer__stop(&t_checkout); + + cl_git_pass(git_repository_set_head(g_repo, git_reference_name(ref_branch_a))); + + git_oid_fromstr(&oid_b, id_b); + cl_git_pass(git_commit_lookup(&commit_b, g_repo, &oid_b)); + cl_git_pass(git_branch_create(&ref_branch_b, g_repo, + "B", commit_b, + 0)); + + cl_git_pass(git_annotated_commit_lookup(&annotated_commits[0], g_repo, &oid_b)); + + perf__timer__start(&t_merge); + cl_git_pass(git_merge(g_repo, + (const git_annotated_commit **)annotated_commits, 1, + &merge_opts, &checkout_opts)); + perf__timer__stop(&t_merge); + + git_reference_free(ref_branch_a); + git_reference_free(ref_branch_b); + git_commit_free(commit_a); + git_commit_free(commit_b); + git_annotated_commit_free(annotated_commits[0]); + git_repository_free(g_repo); + + perf__timer__stop(&t_total); + + perf__timer__report(&t_clone, "%s: clone", test_name); + perf__timer__report(&t_checkout, "%s: checkout", test_name); + perf__timer__report(&t_merge, "%s: merge", test_name); + perf__timer__report(&t_total, "%s: total", test_name); +} diff -Nru libgit2-0.22.2/tests/perf/helper__perf__do_merge.h libgit2-0.23.1/tests/perf/helper__perf__do_merge.h --- libgit2-0.22.2/tests/perf/helper__perf__do_merge.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/perf/helper__perf__do_merge.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +void perf__do_merge(const char *fixture, + const char *test_name, + const char *id_a, + const char *id_b); diff -Nru libgit2-0.22.2/tests/perf/helper__perf__timer.c libgit2-0.23.1/tests/perf/helper__perf__timer.c --- libgit2-0.22.2/tests/perf/helper__perf__timer.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/perf/helper__perf__timer.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,73 @@ +#include "clar_libgit2.h" +#include "helper__perf__timer.h" + +#if defined(GIT_WIN32) + +void perf__timer__start(perf_timer *t) +{ + QueryPerformanceCounter(&t->time_started); +} + +void perf__timer__stop(perf_timer *t) +{ + LARGE_INTEGER time_now; + QueryPerformanceCounter(&time_now); + + t->sum.QuadPart += (time_now.QuadPart - t->time_started.QuadPart); +} + +void perf__timer__report(perf_timer *t, const char *fmt, ...) +{ + va_list arglist; + LARGE_INTEGER freq; + double fraction; + + QueryPerformanceFrequency(&freq); + + fraction = ((double)t->sum.QuadPart) / ((double)freq.QuadPart); + + printf("%10.3f: ", fraction); + + va_start(arglist, fmt); + vprintf(fmt, arglist); + va_end(arglist); + + printf("\n"); +} + +#else + +#include + +static uint32_t now_in_ms(void) +{ + struct timeval now; + gettimeofday(&now, NULL); + return (uint32_t)((now.tv_sec * 1000) + (now.tv_usec / 1000)); +} + +void perf__timer__start(perf_timer *t) +{ + t->time_started = now_in_ms(); +} + +void perf__timer__stop(perf_timer *t) +{ + uint32_t now = now_in_ms(); + t->sum += (now - t->time_started); +} + +void perf__timer__report(perf_timer *t, const char *fmt, ...) +{ + va_list arglist; + + printf("%10.3f: ", ((double)t->sum) / 1000); + + va_start(arglist, fmt); + vprintf(fmt, arglist); + va_end(arglist); + + printf("\n"); +} + +#endif diff -Nru libgit2-0.22.2/tests/perf/helper__perf__timer.h libgit2-0.23.1/tests/perf/helper__perf__timer.h --- libgit2-0.22.2/tests/perf/helper__perf__timer.h 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/perf/helper__perf__timer.h 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,27 @@ +#if defined(GIT_WIN32) + +struct perf__timer +{ + LARGE_INTEGER sum; + LARGE_INTEGER time_started; +}; + +#define PERF_TIMER_INIT {0} + +#else + +struct perf__timer +{ + uint32_t sum; + uint32_t time_started; +}; + +#define PERF_TIMER_INIT {0} + +#endif + +typedef struct perf__timer perf_timer; + +void perf__timer__start(perf_timer *t); +void perf__timer__stop(perf_timer *t); +void perf__timer__report(perf_timer *t, const char *fmt, ...); diff -Nru libgit2-0.22.2/tests/perf/merge.c libgit2-0.23.1/tests/perf/merge.c --- libgit2-0.22.2/tests/perf/merge.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/perf/merge.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,44 @@ +#include "clar_libgit2.h" +#include "helper__perf__do_merge.h" + +/* This test requires a large repo with many files. + * It doesn't care about the contents, just the size. + * + * For now, we use the LibGit2 repo containing the + * source tree because it is already here. + * + * `find . | wc -l` reports 5128. + * + */ +#define SRC_REPO (cl_fixture("../..")) + +/* We need 2 arbitrary commits within that repo + * that have a large number of changed files. + * Again, we don't care about the actual contents, + * just the size. + * + * For now, we use these public branches: + * maint/v0.21 d853fb9f24e0fe63b3dce9fbc04fd9cfe17a030b Always checkout with case sensitive iterator + * maint/v0.22 1ce9ea3ba9b4fa666602d52a5281d41a482cc58b checkout tests: cleanup realpath impl on Win32 + * + */ +#define ID_BRANCH_A "d853fb9f24e0fe63b3dce9fbc04fd9cfe17a030b" +#define ID_BRANCH_B "1ce9ea3ba9b4fa666602d52a5281d41a482cc58b" + + +void test_perf_merge__initialize(void) +{ +} + +void test_perf_merge__cleanup(void) +{ +} + +void test_perf_merge__m1(void) +{ +#if 1 + cl_skip(); +#else + perf__do_merge(SRC_REPO, "m1", ID_BRANCH_A, ID_BRANCH_B); +#endif +} diff -Nru libgit2-0.22.2/tests/rebase/abort.c libgit2-0.23.1/tests/rebase/abort.c --- libgit2-0.22.2/tests/rebase/abort.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/rebase/abort.c 2015-08-03 18:07:35.000000000 +0000 @@ -23,14 +23,12 @@ { git_rebase *rebase; git_reference *head_ref, *branch_ref = NULL; - git_signature *signature; git_status_list *statuslist; git_reflog *reflog; const git_reflog_entry *reflog_entry; - cl_git_pass(git_rebase_open(&rebase, repo)); - cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); - cl_git_pass(git_rebase_abort(rebase, signature)); + cl_git_pass(git_rebase_open(&rebase, repo, NULL)); + cl_git_pass(git_rebase_abort(rebase)); cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); @@ -60,7 +58,6 @@ git_reflog_free(reflog); git_reference_free(head_ref); git_reference_free(branch_ref); - git_signature_free(signature); git_rebase_free(rebase); } @@ -68,7 +65,6 @@ { git_rebase *rebase; git_reference *branch_ref, *onto_ref; - git_signature *signature; git_annotated_commit *branch_head, *onto_head; cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); @@ -77,15 +73,11 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); - cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); - - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL)); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); test_abort(branch_head, onto_head); - git_signature_free(signature); - git_annotated_commit_free(branch_head); git_annotated_commit_free(onto_head); @@ -110,7 +102,7 @@ cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL)); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); test_abort(branch_head, onto_head); @@ -139,7 +131,7 @@ cl_git_pass(git_signature_new(&signature, "Rebaser", "rebaser@example.com", 1404157834, -400)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL)); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); p_rename("rebase-merge/.git/rebase-merge/orig-head", diff -Nru libgit2-0.22.2/tests/rebase/iterator.c libgit2-0.23.1/tests/rebase/iterator.c --- libgit2-0.22.2/tests/rebase/iterator.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/rebase/iterator.c 2015-08-03 18:07:35.000000000 +0000 @@ -42,6 +42,7 @@ operation = git_rebase_operation_byindex(rebase, i); cl_assert_equal_i(GIT_REBASE_OPERATION_PICK, operation->type); cl_assert_equal_oid(&expected_oid[i], &operation->id); + cl_assert_equal_p(NULL, operation->exec); } } @@ -51,52 +52,49 @@ git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; int error; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); - test_operations(rebase, 0); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); + test_operations(rebase, GIT_REBASE_NO_OPERATION); git_rebase_free(rebase); - cl_git_pass(git_rebase_open(&rebase, repo)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_open(&rebase, repo, NULL)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 0); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 1); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 2); git_rebase_free(rebase); - cl_git_pass(git_rebase_open(&rebase, repo)); + cl_git_pass(git_rebase_open(&rebase, repo, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 3); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); test_operations(rebase, 4); - cl_git_fail(error = git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_fail(error = git_rebase_next(&rebase_operation, rebase)); cl_assert_equal_i(GIT_ITEROVER, error); test_operations(rebase, 4); diff -Nru libgit2-0.22.2/tests/rebase/merge.c libgit2-0.23.1/tests/rebase/merge.c --- libgit2-0.22.2/tests/rebase/merge.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/rebase/merge.c 2015-08-03 18:07:35.000000000 +0000 @@ -40,22 +40,19 @@ git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_status_list *status_list; const git_status_entry *status_entry; git_oid pick_id, file1_id; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); git_oid_fromstr(&pick_id, "da9c51a23d02d931a486f45ad18cda05cf5d2b94"); @@ -87,10 +84,9 @@ git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_status_list *status_list; const git_status_entry *status_entry; - git_oid pick_id; + git_oid pick_id, commit_id; const char *expected_merge = "ASPARAGUS SOUP.\n" @@ -112,17 +108,15 @@ "asparagus which had been laid by, boil it until these last articles are\n" "sufficiently done, thicken with flour, butter and milk, and serve it up.\n"; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/asparagus")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); git_oid_fromstr(&pick_id, "33f915f9e4dbd9f4b24430e48731a59b45b15500"); @@ -139,6 +133,8 @@ cl_assert_equal_file(expected_merge, strlen(expected_merge), "rebase/asparagus.txt"); + cl_git_fail_with(GIT_EUNMERGED, git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); + git_status_list_free(status_list); git_annotated_commit_free(branch_head); git_annotated_commit_free(upstream_head); @@ -153,41 +149,38 @@ git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; int error; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_fail(error = git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_fail(error = git_rebase_next(&rebase_operation, rebase)); cl_assert_equal_i(GIT_ITEROVER, error); cl_assert_equal_file("5\n", 2, "rebase/.git/rebase-merge/end"); @@ -206,24 +199,21 @@ git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id, tree_id, parent_id; git_signature *author; git_commit *commit; git_reflog *reflog; const git_reflog_entry *reflog_entry; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); @@ -262,16 +252,48 @@ git_rebase_free(rebase); } -void test_rebase_merge__commit_updates_rewritten(void) +void test_rebase_merge__blocked_when_dirty(void) { git_rebase *rebase; git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; + cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); + cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); + + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); + + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); + + /* Allow untracked files */ + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); + cl_git_mkfile("rebase/untracked_file.txt", "This is untracked\n"); + cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, + NULL, NULL)); + + /* Do not allow unstaged */ + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); + cl_git_mkfile("rebase/veal.txt", "This is an unstaged change\n"); + cl_git_fail_with(GIT_EUNMERGED, git_rebase_commit(&commit_id, rebase, NULL, signature, + NULL, NULL)); + + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); + git_reference_free(branch_ref); + git_reference_free(upstream_ref); + git_rebase_free(rebase); +} + +void test_rebase_merge__commit_updates_rewritten(void) +{ + git_rebase *rebase; + git_reference *branch_ref, *upstream_ref; + git_annotated_commit *branch_head, *upstream_head; + git_rebase_operation *rebase_operation; + git_oid commit_id; cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); @@ -279,13 +301,13 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); @@ -307,27 +329,24 @@ git_reference *branch_ref, *upstream_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; int error; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/green_pea")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_fail(error = git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); cl_assert_equal_i(GIT_EAPPLIED, error); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); @@ -348,30 +367,27 @@ git_reference *branch_ref, *upstream_ref, *head_ref; git_annotated_commit *branch_head, *upstream_head; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid commit_id; git_reflog *reflog; const git_reflog_entry *reflog_entry; int error; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/gravy")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/veal")); cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_fail(error = git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_fail(error = git_rebase_next(&rebase_operation, rebase)); cl_assert_equal_i(GIT_ITEROVER, error); - cl_git_pass(git_rebase_finish(rebase, signature, NULL)); + cl_git_pass(git_rebase_finish(rebase, signature)); cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); @@ -411,13 +427,10 @@ git_annotated_commit *branch_head, *upstream_head; git_commit *branch_commit; git_rebase_operation *rebase_operation; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid note_id, commit_id; git_note *note = NULL; int error; - checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; - cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/gravy")); cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/veal")); @@ -433,13 +446,13 @@ git_commit_id(branch_commit), "This is a commit note.", 0)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, opts)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, opts)); - cl_git_pass(git_rebase_next(&rebase_operation, rebase, &checkout_opts)); + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL)); - cl_git_pass(git_rebase_finish(rebase, signature, opts)); + cl_git_pass(git_rebase_finish(rebase, signature)); cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); @@ -497,3 +510,58 @@ test_copy_note(NULL, 0); } +void rebase_checkout_progress_cb( + const char *path, + size_t completed_steps, + size_t total_steps, + void *payload) +{ + int *called = payload; + + GIT_UNUSED(path); + GIT_UNUSED(completed_steps); + GIT_UNUSED(total_steps); + + *called = 1; +} + +void test_rebase_merge__custom_checkout_options(void) +{ + git_rebase *rebase; + git_reference *branch_ref, *upstream_ref; + git_annotated_commit *branch_head, *upstream_head; + git_rebase_options rebase_options = GIT_REBASE_OPTIONS_INIT; + git_checkout_options checkout_options = GIT_CHECKOUT_OPTIONS_INIT; + git_rebase_operation *rebase_operation; + int called = 0; + + checkout_options.progress_cb = rebase_checkout_progress_cb; + checkout_options.progress_payload = &called; + + memcpy(&rebase_options.checkout_options, &checkout_options, + sizeof(git_checkout_options)); + + cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef")); + cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); + + cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); + + called = 0; + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, &rebase_options)); + cl_assert_equal_i(1, called); + + called = 0; + cl_git_pass(git_rebase_next(&rebase_operation, rebase)); + cl_assert_equal_i(1, called); + + called = 0; + cl_git_pass(git_rebase_abort(rebase)); + cl_assert_equal_i(1, called); + + git_annotated_commit_free(branch_head); + git_annotated_commit_free(upstream_head); + git_reference_free(branch_ref); + git_reference_free(upstream_ref); + git_rebase_free(rebase); +} diff -Nru libgit2-0.22.2/tests/rebase/setup.c libgit2-0.23.1/tests/rebase/setup.c --- libgit2-0.22.2/tests/rebase/setup.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/rebase/setup.c 2015-08-03 18:07:35.000000000 +0000 @@ -39,12 +39,12 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); git_rebase_free(rebase); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); - cl_git_fail(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_fail(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); git_annotated_commit_free(branch_head); git_annotated_commit_free(upstream_head); @@ -70,7 +70,7 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); @@ -118,7 +118,7 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL)); git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"); cl_git_pass(git_repository_head(&head, repo)); @@ -168,7 +168,7 @@ cl_git_pass(git_annotated_commit_from_ref(&branch2_head, repo, branch2_ref)); cl_git_pass(git_annotated_commit_from_ref(&onto_head, repo, onto_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch1_head, branch2_head, onto_head, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch1_head, branch2_head, onto_head, NULL)); git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"); cl_git_pass(git_repository_head(&head, repo)); @@ -215,7 +215,7 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); @@ -263,7 +263,7 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL)); + cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL)); cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); @@ -293,6 +293,55 @@ git_rebase_free(rebase); } +/* git checkout beef && git rebase --merge master */ +void test_rebase_setup__merge_null_branch_uses_HEAD(void) +{ + git_rebase *rebase; + git_reference *upstream_ref; + git_annotated_commit *upstream_head; + git_reference *head; + git_commit *head_commit; + git_oid head_id; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + + checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; + + cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo)); + + cl_git_pass(git_repository_set_head(repo, "refs/heads/beef")); + cl_git_pass(git_checkout_head(repo, &checkout_opts)); + + cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master")); + cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); + + cl_git_pass(git_rebase_init(&rebase, repo, NULL, upstream_head, NULL, NULL)); + + cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo)); + + git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"); + cl_git_pass(git_repository_head(&head, repo)); + cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJ_COMMIT)); + cl_assert_equal_oid(&head_id, git_commit_id(head_commit)); + + cl_assert_equal_file("b146bd7608eac53d9bf9e1a6963543588b555c64\n", 41, "rebase/.git/ORIG_HEAD"); + + cl_assert_equal_file("da9c51a23d02d931a486f45ad18cda05cf5d2b94\n", 41, "rebase/.git/rebase-merge/cmt.1"); + cl_assert_equal_file("8d1f13f93c4995760ac07d129246ac1ff64c0be9\n", 41, "rebase/.git/rebase-merge/cmt.2"); + cl_assert_equal_file("3069cc907e6294623e5917ef6de663928c1febfb\n", 41, "rebase/.git/rebase-merge/cmt.3"); + cl_assert_equal_file("588e5d2f04d49707fe4aab865e1deacaf7ef6787\n", 41, "rebase/.git/rebase-merge/cmt.4"); + cl_assert_equal_file("b146bd7608eac53d9bf9e1a6963543588b555c64\n", 41, "rebase/.git/rebase-merge/cmt.5"); + cl_assert_equal_file("5\n", 2, "rebase/.git/rebase-merge/end"); + cl_assert_equal_file("efad0b11c47cb2f0220cbd6f5b0f93bb99064b00\n", 41, "rebase/.git/rebase-merge/onto"); + cl_assert_equal_file("master\n", 7, "rebase/.git/rebase-merge/onto_name"); + cl_assert_equal_file("b146bd7608eac53d9bf9e1a6963543588b555c64\n", 41, "rebase/.git/rebase-merge/orig-head"); + + git_commit_free(head_commit); + git_reference_free(head); + git_annotated_commit_free(upstream_head); + git_reference_free(upstream_ref); + git_rebase_free(rebase); +} + static int rebase_is_blocked(void) { git_rebase *rebase = NULL; @@ -309,7 +358,7 @@ cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref)); cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref)); - error = git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, signature, NULL); + error = git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL); git_annotated_commit_free(branch_head); git_annotated_commit_free(upstream_head); diff -Nru libgit2-0.22.2/tests/refs/branches/create.c libgit2-0.23.1/tests/refs/branches/create.c --- libgit2-0.22.2/tests/refs/branches/create.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/create.c 2015-08-03 18:07:35.000000000 +0000 @@ -45,7 +45,7 @@ { retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, 0)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); } @@ -53,14 +53,14 @@ { retrieve_known_commit(&target, repo); - cl_assert_equal_i(GIT_EEXISTS, git_branch_create(&branch, repo, "br2", target, 0, NULL, NULL)); + cl_assert_equal_i(GIT_EEXISTS, git_branch_create(&branch, repo, "br2", target, 0)); } void test_refs_branches_create__can_force_create_over_an_existing_branch(void) { retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, "br2", target, 1, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "br2", target, 1)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_assert_equal_s("refs/heads/br2", git_reference_name(branch)); } @@ -76,7 +76,7 @@ cl_assert_equal_i(true, git_branch_is_head(branch2)); oid = git_reference_target(branch2); - cl_git_fail_with(-1, git_branch_create(&branch, repo, "master", target, 1, NULL, NULL)); + cl_git_fail_with(-1, git_branch_create(&branch, repo, "master", target, 1)); branch = NULL; cl_git_pass(git_branch_lookup(&branch, repo, "master", GIT_BRANCH_LOCAL)); cl_assert_equal_s("refs/heads/master", git_reference_name(branch)); @@ -89,34 +89,15 @@ retrieve_known_commit(&target, repo); cl_assert_equal_i(GIT_EINVALIDSPEC, - git_branch_create(&branch, repo, "inv@{id", target, 0, NULL, NULL)); -} - -void test_refs_branches_create__creation_creates_new_reflog(void) -{ - git_reflog *log; - const git_reflog_entry *entry; - git_signature *sig; - - cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); - - retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false, sig, "create!")); - cl_git_pass(git_reflog_read(&log, repo, "refs/heads/" NEW_BRANCH_NAME)); - - cl_assert_equal_i(1, git_reflog_entrycount(log)); - entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s("create!", git_reflog_entry_message(entry)); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); - - git_reflog_free(log); - git_signature_free(sig); + git_branch_create(&branch, repo, "inv@{id", target, 0)); } void test_refs_branches_create__default_reflog_message(void) { git_reflog *log; + git_buf buf = GIT_BUF_INIT; const git_reflog_entry *entry; + git_annotated_commit *annotated; git_signature *sig; git_config *cfg; @@ -128,13 +109,30 @@ cl_git_pass(git_signature_default(&sig, repo)); retrieve_known_commit(&target, repo); - cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, NEW_BRANCH_NAME, target, false)); + cl_git_pass(git_reflog_read(&log, repo, "refs/heads/" NEW_BRANCH_NAME)); + + entry = git_reflog_entry_byindex(log, 0); + cl_git_pass(git_buf_printf(&buf, "branch: Created from %s", git_oid_tostr_s(git_commit_id(target)))); + cl_assert_equal_s(git_buf_cstr(&buf), git_reflog_entry_message(entry)); + cl_assert_equal_s(sig->email, git_reflog_entry_committer(entry)->email); + + cl_git_pass(git_reference_remove(repo, "refs/heads/" NEW_BRANCH_NAME)); + git_reference_free(branch); + git_reflog_free(log); + git_buf_clear(&buf); + + cl_git_pass(git_annotated_commit_from_revspec(&annotated, repo, "e90810b8df3")); + cl_git_pass(git_branch_create_from_annotated(&branch, repo, NEW_BRANCH_NAME, annotated, true)); cl_git_pass(git_reflog_read(&log, repo, "refs/heads/" NEW_BRANCH_NAME)); entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s("Branch: created", git_reflog_entry_message(entry)); + cl_git_pass(git_buf_printf(&buf, "branch: Created from e90810b8df3")); + cl_assert_equal_s(git_buf_cstr(&buf), git_reflog_entry_message(entry)); cl_assert_equal_s(sig->email, git_reflog_entry_committer(entry)->email); + git_annotated_commit_free(annotated); + git_buf_free(&buf); git_reflog_free(log); git_signature_free(sig); } @@ -181,7 +179,7 @@ for (i = 0; i < ARRAY_SIZE(names); ++i) { const char *name; cl_git_pass(git_branch_create( - &branch, repo, names[i], target, 0, NULL, NULL)); + &branch, repo, names[i], target, 0)); cl_git_pass(git_oid_cmp( git_reference_target(branch), git_commit_id(target))); @@ -239,7 +237,7 @@ retrieve_known_commit(&target, repo); for (p=item; p->first; p++) { - cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_git_pass(git_branch_name(&name, branch)); cl_assert_equal_s(name, p->first); @@ -248,7 +246,7 @@ git_reference_free(branch); branch = NULL; - cl_git_pass(git_branch_create(&branch, repo, p->second, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->second, target, 0)); git_reference_free(branch); branch = NULL; } @@ -277,7 +275,7 @@ retrieve_known_commit(&target, repo); for (p=item; p->first; p++) { - cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->first, target, 0)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_git_pass(git_branch_name(&name, branch)); cl_assert_equal_s(name, p->first); @@ -286,7 +284,7 @@ git_reference_free(branch); branch = NULL; - cl_git_pass(git_branch_create(&branch, repo, p->first_alternate, target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, p->first_alternate, target, 0)); cl_git_pass(git_oid_cmp(git_reference_target(branch), git_commit_id(target))); cl_git_pass(git_branch_name(&name, branch)); cl_assert_equal_s(name, p->first_alternate); @@ -295,7 +293,7 @@ git_reference_free(branch); branch = NULL; - cl_git_fail(git_branch_create(&branch, repo, p->second, target, 0, NULL, NULL)); + cl_git_fail(git_branch_create(&branch, repo, p->second, target, 0)); git_reference_free(branch); branch = NULL; } diff -Nru libgit2-0.22.2/tests/refs/branches/delete.c libgit2-0.23.1/tests/refs/branches/delete.c --- libgit2-0.22.2/tests/refs/branches/delete.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/delete.c 2015-08-03 18:07:35.000000000 +0000 @@ -13,7 +13,7 @@ repo = cl_git_sandbox_init("testrepo.git"); cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); - cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL)); } void test_refs_branches_delete__cleanup(void) @@ -75,7 +75,7 @@ git_reference_free(head); /* Detach HEAD and make it target the commit that "master" points to */ - git_repository_detach_head(repo, NULL, NULL); + git_repository_detach_head(repo); cl_git_pass(git_branch_lookup(&branch, repo, "master", GIT_BRANCH_LOCAL)); cl_git_pass(git_branch_delete(branch)); diff -Nru libgit2-0.22.2/tests/refs/branches/ishead.c libgit2-0.23.1/tests/refs/branches/ishead.c --- libgit2-0.22.2/tests/refs/branches/ishead.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/ishead.c 2015-08-03 18:07:35.000000000 +0000 @@ -82,9 +82,9 @@ { git_reference *linked, *super, *head; - cl_git_pass(git_reference_symbolic_create(&linked, repo, "refs/heads/linked", "refs/heads/master", 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&super, repo, "refs/heads/super", "refs/heads/linked", 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, "refs/heads/super", 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&linked, repo, "refs/heads/linked", "refs/heads/master", 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&super, repo, "refs/heads/super", "refs/heads/linked", 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, "refs/heads/super", 1, NULL)); cl_assert_equal_i(false, git_branch_is_head(linked)); cl_assert_equal_i(false, git_branch_is_head(super)); diff -Nru libgit2-0.22.2/tests/refs/branches/iterator.c libgit2-0.23.1/tests/refs/branches/iterator.c --- libgit2-0.22.2/tests/refs/branches/iterator.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/iterator.c 2015-08-03 18:07:35.000000000 +0000 @@ -12,7 +12,7 @@ cl_git_pass(git_repository_open(&repo, "testrepo.git")); cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); - cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL)); } void test_refs_branches_iterator__cleanup(void) @@ -113,7 +113,7 @@ }; git_reference_free(fake_remote); - cl_git_pass(git_reference_symbolic_create(&fake_remote, repo, "refs/remotes/nulltoken/HEAD", "refs/remotes/nulltoken/master", 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&fake_remote, repo, "refs/remotes/nulltoken/HEAD", "refs/remotes/nulltoken/master", 0, NULL)); assert_retrieval(GIT_BRANCH_REMOTE, 3); diff -Nru libgit2-0.22.2/tests/refs/branches/move.c libgit2-0.23.1/tests/refs/branches/move.c --- libgit2-0.22.2/tests/refs/branches/move.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/move.c 2015-08-03 18:07:35.000000000 +0000 @@ -22,7 +22,7 @@ cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_git_pass(git_branch_move(&new_ref, original_ref, NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, NEW_BRANCH_NAME, 0)); cl_assert_equal_s(GIT_REFS_HEADS_DIR NEW_BRANCH_NAME, git_reference_name(new_ref)); git_reference_free(original_ref); @@ -36,11 +36,11 @@ cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); /* Downward */ - cl_git_pass(git_branch_move(&new_ref, original_ref, "somewhere/" NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, "somewhere/" NEW_BRANCH_NAME, 0)); git_reference_free(original_ref); /* Upward */ - cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0)); git_reference_free(new_ref); git_reference_free(newer_ref); @@ -53,11 +53,11 @@ cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); /* Downward */ - cl_git_pass(git_branch_move(&new_ref, original_ref, "br2/" NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, "br2/" NEW_BRANCH_NAME, 0)); git_reference_free(original_ref); /* Upward */ - cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&newer_ref, new_ref, "br2", 0)); git_reference_free(new_ref); git_reference_free(newer_ref); @@ -67,51 +67,59 @@ { git_reference *original_ref, *new_ref; git_config *config; - const git_config_entry *ce; + git_buf buf = GIT_BUF_INIT; char *original_remote, *original_merge; + const char *str; - cl_git_pass(git_repository_config(&config, repo)); - - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); - original_remote = strdup(ce->value); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.merge")); - original_merge = strdup(ce->value); + cl_git_pass(git_repository_config_snapshot(&config, repo)); + cl_git_pass(git_config_get_string_buf(&buf, config, "branch.master.remote")); + original_remote = git_buf_detach(&buf); + cl_git_pass(git_config_get_string_buf(&buf, config, "branch.master.merge")); + original_merge = git_buf_detach(&buf); + git_config_free(config); cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); cl_assert_equal_i(GIT_EEXISTS, - git_branch_move(&new_ref, original_ref, "master", 0, NULL, NULL)); + git_branch_move(&new_ref, original_ref, "master", 0)); cl_assert(giterr_last()->message != NULL); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); - cl_assert_equal_s(original_remote, ce->value); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.merge")); - cl_assert_equal_s(original_merge, ce->value); + cl_git_pass(git_repository_config_snapshot(&config, repo)); + cl_git_pass(git_config_get_string(&str, config, "branch.master.remote")); + cl_assert_equal_s(original_remote, str); + cl_git_pass(git_config_get_string(&str, config, "branch.master.merge")); + cl_assert_equal_s(original_merge, str); + git_config_free(config); cl_assert_equal_i(GIT_EEXISTS, - git_branch_move(&new_ref, original_ref, "cannot-fetch", 0, NULL, NULL)); + git_branch_move(&new_ref, original_ref, "cannot-fetch", 0)); cl_assert(giterr_last()->message != NULL); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); - cl_assert_equal_s(original_remote, ce->value); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.merge")); - cl_assert_equal_s(original_merge, ce->value); + + cl_git_pass(git_repository_config_snapshot(&config, repo)); + cl_git_pass(git_config_get_string(&str, config, "branch.master.remote")); + cl_assert_equal_s(original_remote, str); + cl_git_pass(git_config_get_string(&str, config, "branch.master.merge")); + cl_assert_equal_s(original_merge, str); + git_config_free(config); git_reference_free(original_ref); cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/track-local")); cl_assert_equal_i(GIT_EEXISTS, - git_branch_move(&new_ref, original_ref, "master", 0, NULL, NULL)); + git_branch_move(&new_ref, original_ref, "master", 0)); cl_assert(giterr_last()->message != NULL); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.remote")); - cl_assert_equal_s(original_remote, ce->value); - cl_git_pass(git_config_get_entry(&ce, config, "branch.master.merge")); - cl_assert_equal_s(original_merge, ce->value); - free(original_remote); free(original_merge); + cl_git_pass(git_repository_config_snapshot(&config, repo)); + cl_git_pass(git_config_get_string(&str, config, "branch.master.remote")); + cl_assert_equal_s(original_remote, str); + cl_git_pass(git_config_get_string(&str, config, "branch.master.merge")); + cl_assert_equal_s(original_merge, str); + + git__free(original_remote); git__free(original_merge); git_reference_free(original_ref); git_config_free(config); } @@ -122,7 +130,7 @@ cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_assert_equal_i(GIT_EINVALIDSPEC, git_branch_move(&new_ref, original_ref, "Inv@{id", 0, NULL, NULL)); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_branch_move(&new_ref, original_ref, "Inv@{id", 0)); git_reference_free(original_ref); } @@ -132,7 +140,7 @@ git_reference *tag, *new_ref; cl_git_pass(git_reference_lookup(&tag, repo, "refs/tags/e90810b")); - cl_git_fail(git_branch_move(&new_ref, tag, NEW_BRANCH_NAME, 0, NULL, NULL)); + cl_git_fail(git_branch_move(&new_ref, tag, NEW_BRANCH_NAME, 0)); git_reference_free(tag); } @@ -143,7 +151,7 @@ cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_git_pass(git_branch_move(&new_ref, original_ref, "master", 1, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, "master", 1)); git_reference_free(original_ref); git_reference_free(new_ref); @@ -161,7 +169,7 @@ assert_config_entry_existence(repo, "branch.moved.remote", false); assert_config_entry_existence(repo, "branch.moved.merge", false); - cl_git_pass(git_branch_move(&new_branch, branch, "moved", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_branch, branch, "moved", 0)); git_reference_free(branch); assert_config_entry_existence(repo, "branch.track-local.remote", false); @@ -178,7 +186,7 @@ git_reference *new_branch; cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master")); - cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0)); git_reference_free(branch); git_reference_free(new_branch); @@ -187,30 +195,6 @@ git_reference_free(branch); } -void test_refs_branches_move__updates_the_reflog(void) -{ - git_reference *branch; - git_reference *new_branch; - git_reflog *log; - const git_reflog_entry *entry; - git_signature *sig; - - cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); - - cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master")); - cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, sig, "message")); - - cl_git_pass(git_reflog_read(&log, repo, git_reference_name(new_branch))); - entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s("message", git_reflog_entry_message(entry)); - cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email); - - git_reference_free(branch); - git_reference_free(new_branch); - git_reflog_free(log); - git_signature_free(sig); -} - void test_refs_branches_move__default_reflog_message(void) { git_reference *branch; @@ -219,6 +203,7 @@ const git_reflog_entry *entry; git_signature *sig; git_config *cfg; + git_oid id; cl_git_pass(git_repository_config(&cfg, repo)); cl_git_pass(git_config_set_string(cfg, "user.name", "Foo Bar")); @@ -228,13 +213,16 @@ cl_git_pass(git_signature_default(&sig, repo)); cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master")); - cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL, NULL)); + git_oid_cpy(&id, git_reference_target(branch)); + cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0)); cl_git_pass(git_reflog_read(&log, repo, git_reference_name(new_branch))); entry = git_reflog_entry_byindex(log, 0); - cl_assert_equal_s("Branch: renamed refs/heads/master to refs/heads/master2", + cl_assert_equal_s("branch: renamed refs/heads/master to refs/heads/master2", git_reflog_entry_message(entry)); cl_assert_equal_s(sig->email, git_reflog_entry_committer(entry)->email); + cl_assert_equal_oid(&id, git_reflog_entry_id_old(entry)); + cl_assert_equal_oid(&id, git_reflog_entry_id_new(entry)); git_reference_free(branch); git_reference_free(new_branch); @@ -248,7 +236,7 @@ const char *new_branch_name = "\x41\xCC\x8A\x73\x74\x72\x6F\xCC\x88\x6D"; cl_git_pass(git_reference_lookup(&original_ref, repo, "refs/heads/br2")); - cl_git_pass(git_branch_move(&new_ref, original_ref, new_branch_name, 0, NULL, NULL)); + cl_git_pass(git_branch_move(&new_ref, original_ref, new_branch_name, 0)); if (cl_repo_get_bool(repo, "core.precomposeunicode")) cl_assert_equal_s(GIT_REFS_HEADS_DIR "\xC3\x85\x73\x74\x72\xC3\xB6\x6D", git_reference_name(new_ref)); diff -Nru libgit2-0.22.2/tests/refs/branches/remote.c libgit2-0.23.1/tests/refs/branches/remote.c --- libgit2-0.22.2/tests/refs/branches/remote.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/remote.c 2015-08-03 18:07:35.000000000 +0000 @@ -57,12 +57,7 @@ git_buf buf; /* Create the remote */ - cl_git_pass(git_remote_create(&remote, g_repo, "addtest", "http://github.com/libgit2/libgit2")); - - /* Update the remote fetch spec */ - git_remote_clear_refspecs(remote); - cl_git_pass(git_remote_add_fetch(remote, "refs/heads/*:refs/remotes/test/*")); - cl_git_pass(git_remote_save(remote)); + cl_git_pass(git_remote_create_with_fetchspec(&remote, g_repo, "addtest", "http://github.com/libgit2/libgit2", "refs/heads/*:refs/remotes/test/*")); git_remote_free(remote); diff -Nru libgit2-0.22.2/tests/refs/branches/upstream.c libgit2-0.23.1/tests/refs/branches/upstream.c --- libgit2-0.22.2/tests/refs/branches/upstream.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/branches/upstream.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,4 +1,5 @@ #include "clar_libgit2.h" +#include "config/config_helpers.h" #include "refs.h" static git_repository *repo; @@ -91,7 +92,7 @@ git_reference *branch; cl_assert_equal_i(GIT_OBJ_COMMIT, git_object_type((git_object*)target)); - cl_git_pass(git_branch_create(&branch, repository, entry_name, (git_commit*)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repository, entry_name, (git_commit*)target, 0)); cl_assert_equal_i(GIT_ENOTFOUND, git_branch_upstream(&upstream, branch)); @@ -123,8 +124,6 @@ { git_reference *branch; git_repository *repository; - const char *value; - git_config *config; repository = cl_git_sandbox_init("testrepo.git"); @@ -132,11 +131,8 @@ cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/test")); cl_git_pass(git_branch_set_upstream(branch, "test/master")); - cl_git_pass(git_repository_config(&config, repository)); - cl_git_pass(git_config_get_string(&value, config, "branch.test.remote")); - cl_assert_equal_s(value, "test"); - cl_git_pass(git_config_get_string(&value, config, "branch.test.merge")); - cl_assert_equal_s(value, "refs/heads/master"); + assert_config_entry_value(repository, "branch.test.remote", "test"); + assert_config_entry_value(repository, "branch.test.merge", "refs/heads/master"); git_reference_free(branch); @@ -144,25 +140,54 @@ cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/test")); cl_git_pass(git_branch_set_upstream(branch, "master")); - cl_git_pass(git_config_get_string(&value, config, "branch.test.remote")); - cl_assert_equal_s(value, "."); - cl_git_pass(git_config_get_string(&value, config, "branch.test.merge")); - cl_assert_equal_s(value, "refs/heads/master"); + assert_config_entry_value(repository, "branch.test.remote", "."); + assert_config_entry_value(repository, "branch.test.merge", "refs/heads/master"); /* unset */ cl_git_pass(git_branch_set_upstream(branch, NULL)); - cl_git_fail_with(git_config_get_string(&value, config, "branch.test.merge"), GIT_ENOTFOUND); - cl_git_fail_with(git_config_get_string(&value, config, "branch.test.remote"), GIT_ENOTFOUND); + assert_config_entry_existence(repository, "branch.test.remote", false); + assert_config_entry_existence(repository, "branch.test.merge", false); git_reference_free(branch); cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/master")); cl_git_pass(git_branch_set_upstream(branch, NULL)); - cl_git_fail_with(git_config_get_string(&value, config, "branch.master.merge"), GIT_ENOTFOUND); - cl_git_fail_with(git_config_get_string(&value, config, "branch.master.remote"), GIT_ENOTFOUND); + assert_config_entry_existence(repository, "branch.test.remote", false); + assert_config_entry_existence(repository, "branch.test.merge", false); git_reference_free(branch); - git_config_free(config); + cl_git_sandbox_cleanup(); +} + +void test_refs_branches_upstream__no_fetch_refspec(void) +{ + git_reference *ref, *branch; + git_repository *repo; + git_remote *remote; + git_config *cfg; + + repo = cl_git_sandbox_init("testrepo.git"); + + cl_git_pass(git_remote_create_with_fetchspec(&remote, repo, "matching", ".", NULL)); + cl_git_pass(git_remote_add_push(repo, "matching", ":")); + + cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/test")); + cl_git_pass(git_reference_create(&ref, repo, "refs/remotes/matching/master", git_reference_target(branch), 1, "fetch")); + cl_git_fail(git_branch_set_upstream(branch, "matching/master")); + cl_assert_equal_s("Could not determine remote for 'refs/remotes/matching/master'", + giterr_last()->message); + + /* we can't set it automatically, so let's test the user setting it by hand */ + cl_git_pass(git_repository_config(&cfg, repo)); + cl_git_pass(git_config_set_string(cfg, "branch.test.remote", "matching")); + cl_git_pass(git_config_set_string(cfg, "branch.test.merge", "refs/heads/master")); + /* we still can't find it because there is no rule for that reference */ + cl_git_fail_with(GIT_ENOTFOUND, git_branch_upstream(&ref, branch)); + + git_reference_free(ref); + git_reference_free(branch); + git_remote_free(remote); + cl_git_sandbox_cleanup(); } diff -Nru libgit2-0.22.2/tests/refs/crashes.c libgit2-0.23.1/tests/refs/crashes.c --- libgit2-0.22.2/tests/refs/crashes.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/crashes.c 2015-08-03 18:07:35.000000000 +0000 @@ -7,7 +7,7 @@ const char *REFNAME = "refs/heads/xxx"; cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git"))); - cl_git_pass(git_reference_symbolic_create(&ref, repo, REFNAME, "refs/heads/master", 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, repo, REFNAME, "refs/heads/master", 0, NULL)); cl_git_pass(git_reference_lookup(&ref2, repo, REFNAME)); cl_git_pass(git_reference_delete(ref)); git_reference_free(ref); diff -Nru libgit2-0.22.2/tests/refs/create.c libgit2-0.23.1/tests/refs/create.c --- libgit2-0.22.2/tests/refs/create.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/create.c 2015-08-03 18:07:35.000000000 +0000 @@ -32,7 +32,7 @@ git_oid_fromstr(&id, current_master_tip); /* Create and write the new symbolic reference */ - cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL)); /* Ensure the reference can be looked-up... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head_tracker)); @@ -73,7 +73,7 @@ git_oid_fromstr(&id, current_master_tip); - cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL)); cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head_tracker)); cl_git_pass(git_reference_resolve(&resolved_ref, looked_up_ref)); cl_assert_equal_oid(&id, git_reference_target(resolved_ref)); @@ -95,7 +95,7 @@ git_oid_fromstr(&id, current_master_tip); /* Create and write the new object id reference */ - cl_git_pass(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL)); /* Ensure the reference can be looked-up... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head)); @@ -130,7 +130,7 @@ git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644"); /* Create and write the new object id reference */ - cl_git_fail(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL, NULL)); + cl_git_fail(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL)); /* Ensure the reference can't be looked-up... */ cl_git_fail(git_reference_lookup(&looked_up_ref, g_repo, new_head)); @@ -144,10 +144,10 @@ /* Make sure it works for oid and for symbolic both */ git_oid_fromstr(&oid, current_master_tip); - error = git_reference_create(&ref, g_repo, current_head_target, &oid, false, NULL, NULL); + error = git_reference_create(&ref, g_repo, current_head_target, &oid, false, NULL); cl_assert(error == GIT_EEXISTS); - error = git_reference_symbolic_create(&ref, g_repo, "HEAD", current_head_target, false, NULL, NULL); + error = git_reference_symbolic_create(&ref, g_repo, "HEAD", current_head_target, false, NULL); cl_assert(error == GIT_EEXISTS); } @@ -159,10 +159,10 @@ git_oid_fromstr(&id, current_master_tip); cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_create( - &new_reference, g_repo, name, &id, 0, NULL, NULL)); + &new_reference, g_repo, name, &id, 0, NULL)); cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create( - &new_reference, g_repo, name, current_head_target, 0, NULL, NULL)); + &new_reference, g_repo, name, current_head_target, 0, NULL)); } void test_refs_create__creating_a_reference_with_an_invalid_name_returns_EINVALIDSPEC(void) @@ -188,7 +188,7 @@ git_oid_fromstr(&id, current_master_tip); - ret = git_reference_create(&new_reference, g_repo, name, &id, 0, NULL, NULL); + ret = git_reference_create(&new_reference, g_repo, name, &id, 0, NULL); #ifdef GIT_WIN32 cl_assert_equal_i(GIT_EINVALIDSPEC, ret); diff -Nru libgit2-0.22.2/tests/refs/createwithlog.c libgit2-0.23.1/tests/refs/createwithlog.c --- libgit2-0.22.2/tests/refs/createwithlog.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/createwithlog.c 2015-08-03 18:07:35.000000000 +0000 @@ -23,7 +23,6 @@ { git_reference *reference; git_oid id; - git_signature *signature; git_reflog *reflog; const git_reflog_entry *entry; @@ -32,10 +31,8 @@ git_oid_fromstr(&id, current_master_tip); - cl_git_pass(git_signature_now(&signature, "foo", "foo@bar")); - cl_git_pass( - git_reference_create(&reference, g_repo, name, &id, 0, signature, message)); + git_reference_create(&reference, g_repo, name, &id, 0, message)); cl_git_pass(git_reflog_read(&reflog, g_repo, name)); cl_assert_equal_sz(1, git_reflog_entrycount(reflog)); @@ -47,5 +44,4 @@ git_reflog_free(reflog); git_reference_free(reference); - git_signature_free(signature); } diff -Nru libgit2-0.22.2/tests/refs/delete.c libgit2-0.23.1/tests/refs/delete.c --- libgit2-0.22.2/tests/refs/delete.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/delete.c 2015-08-03 18:07:35.000000000 +0000 @@ -66,7 +66,7 @@ git_oid_fromstr(&id, current_master_tip); /* Create and write the new object id reference */ - cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &id, 0, NULL)); git_reference_free(ref); /* Lookup the reference */ diff -Nru libgit2-0.22.2/tests/refs/foreachglob.c libgit2-0.23.1/tests/refs/foreachglob.c --- libgit2-0.22.2/tests/refs/foreachglob.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/foreachglob.c 2015-08-03 18:07:35.000000000 +0000 @@ -12,7 +12,7 @@ cl_git_pass(git_repository_open(&repo, "testrepo.git")); cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644")); - cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL)); } void test_refs_foreachglob__cleanup(void) diff -Nru libgit2-0.22.2/tests/refs/list.c libgit2-0.23.1/tests/refs/list.c --- libgit2-0.22.2/tests/refs/list.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/list.c 2015-08-03 18:07:35.000000000 +0000 @@ -36,7 +36,7 @@ /* We have exactly 12 refs in total if we include the packed ones: * there is a reference that exists both in the packfile and as * loose, but we only list it once */ - cl_assert_equal_i((int)ref_list.count, 14); + cl_assert_equal_i((int)ref_list.count, 15); git_strarray_free(&ref_list); } @@ -51,7 +51,7 @@ "144344043ba4d4a405da03de3844aa829ae8be0e\n"); cl_git_pass(git_reference_list(&ref_list, g_repo)); - cl_assert_equal_i((int)ref_list.count, 14); + cl_assert_equal_i((int)ref_list.count, 15); git_strarray_free(&ref_list); } diff -Nru libgit2-0.22.2/tests/refs/overwrite.c libgit2-0.23.1/tests/refs/overwrite.c --- libgit2-0.22.2/tests/refs/overwrite.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/overwrite.c 2015-08-03 18:07:35.000000000 +0000 @@ -27,8 +27,8 @@ git_reference *ref, *branch_ref; /* The target needds to exist and we need to check the name has changed */ - cl_git_pass(git_reference_symbolic_create(&branch_ref, g_repo, ref_branch_name, ref_master_name, 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_branch_name, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&branch_ref, g_repo, ref_branch_name, ref_master_name, 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_branch_name, 0, NULL)); git_reference_free(ref); /* Ensure it points to the right place*/ @@ -38,8 +38,8 @@ git_reference_free(ref); /* Ensure we can't create it unless we force it to */ - cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL, NULL)); + cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL)); git_reference_free(ref); /* Ensure it points to the right place */ @@ -63,7 +63,7 @@ git_reference_free(ref); /* Create it */ - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); git_reference_free(ref); cl_git_pass(git_reference_lookup(&ref, g_repo, ref_test_name)); @@ -72,8 +72,8 @@ git_reference_free(ref); /* Ensure we can't overwrite unless we force it */ - cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL, NULL)); + cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL)); git_reference_free(ref); /* Ensure it has been overwritten */ @@ -94,10 +94,10 @@ git_oid_cpy(&id, git_reference_target(ref)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); git_reference_free(ref); - cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL, NULL)); + cl_git_fail(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 1, NULL)); git_reference_free(ref); /* Ensure it points to the right place */ @@ -120,11 +120,11 @@ git_reference_free(ref); /* Create the symbolic ref */ - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); git_reference_free(ref); /* It shouldn't overwrite unless we tell it to */ - cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL, NULL)); - cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL, NULL)); + cl_git_fail(git_reference_create(&ref, g_repo, ref_name, &id, 0, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, ref_name, &id, 1, NULL)); git_reference_free(ref); /* Ensure it points to the right place */ diff -Nru libgit2-0.22.2/tests/refs/pack.c libgit2-0.23.1/tests/refs/pack.c --- libgit2-0.22.2/tests/refs/pack.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/pack.c 2015-08-03 18:07:35.000000000 +0000 @@ -93,11 +93,11 @@ for (i = 0; i < 100; ++i) { p_snprintf(name, sizeof(name), "refs/heads/symbolic-%03d", i); cl_git_pass(git_reference_symbolic_create( - &ref, g_repo, name, "refs/heads/master", 0, NULL, NULL)); + &ref, g_repo, name, "refs/heads/master", 0, NULL)); git_reference_free(ref); p_snprintf(name, sizeof(name), "refs/heads/direct-%03d", i); - cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL)); git_reference_free(ref); } diff -Nru libgit2-0.22.2/tests/refs/races.c libgit2-0.23.1/tests/refs/races.c --- libgit2-0.22.2/tests/refs/races.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/races.c 2015-08-03 18:07:35.000000000 +0000 @@ -30,11 +30,11 @@ git_oid_fromstr(&id, commit_id); git_oid_fromstr(&other_id, other_commit_id); - cl_git_fail_with(GIT_EMODIFIED, git_reference_create_matching(&ref, g_repo, refname, &other_id, 1, &other_id, NULL, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_create_matching(&ref, g_repo, refname, &other_id, 1, &other_id, NULL)); cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL, NULL)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL, NULL)); + cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -49,11 +49,11 @@ git_oid_fromstr(&id, commit_id); git_oid_fromstr(&other_id, other_commit_id); - cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_create_matching(&ref, g_repo, "HEAD", other_refname, 1, other_refname, NULL, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_create_matching(&ref, g_repo, "HEAD", other_refname, 1, other_refname, NULL)); cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, NULL, refname)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, refname)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -75,18 +75,18 @@ /* We cannot delete a symbolic value that doesn't match */ cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, NULL, refname)); + cl_git_pass(git_reference_symbolic_create_matching(&ref2, g_repo, "HEAD", other_refname, 1, NULL, refname)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); git_reference_free(ref2); - cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL)); git_reference_free(ref); /* We cannot delete an oid value that doesn't match */ cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL, NULL)); + cl_git_pass(git_reference_create_matching(&ref2, g_repo, refname, &other_id, 1, &id, NULL)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); @@ -103,19 +103,19 @@ /* Removing a direct ref when it's currently symbolic should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); git_reference_free(ref2); - cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, NULL)); git_reference_free(ref); /* Updating a direct ref when it's currently symbolic should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, refname)); - cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL, NULL)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref2, g_repo, refname, other_refname, 1, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_set_target(&ref3, ref, &other_id, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -132,19 +132,19 @@ /* Removing a symbolic ref when it's currently direct should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL)); cl_git_fail_with(GIT_EMODIFIED, git_reference_delete(ref)); git_reference_free(ref); git_reference_free(ref2); - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, "HEAD", refname, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, "HEAD", refname, 1, NULL)); git_reference_free(ref); /* Updating a symbolic ref when it's currently direct should fail */ cl_git_pass(git_reference_lookup(&ref, g_repo, "HEAD")); - cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL, NULL)); - cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL, NULL)); + cl_git_pass(git_reference_create(&ref2, g_repo, "HEAD", &id, 1, NULL)); + cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_set_target(&ref3, ref, other_refname, NULL)); git_reference_free(ref); git_reference_free(ref2); diff -Nru libgit2-0.22.2/tests/refs/reflog/reflog.c libgit2-0.23.1/tests/refs/reflog/reflog.c --- libgit2-0.22.2/tests/refs/reflog/reflog.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/reflog/reflog.c 2015-08-03 18:07:35.000000000 +0000 @@ -82,7 +82,7 @@ /* Create a new branch pointing at the HEAD */ git_oid_fromstr(&oid, current_master_tip); - cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &oid, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &oid, 0, NULL)); git_reference_free(ref); cl_git_pass(git_signature_now(&committer, "foo", "foo@bar")); @@ -114,7 +114,7 @@ cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&moved_log_path))); cl_git_pass(git_reference_lookup(&master, g_repo, "refs/heads/master")); - cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL)); git_reference_free(master); cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&master_log_path))); @@ -165,7 +165,7 @@ cl_git_pass(git_reflog_write(reflog)); - cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_master, master, "refs/moved", 0, NULL)); git_reference_free(master); cl_git_fail(git_reflog_write(reflog)); @@ -189,11 +189,11 @@ git_oid_fromstr(&id, current_master_tip); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/foo", &id, 1, NULL)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL)); git_reference_free(ref); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/notes/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/notes/foo", &id, 1, NULL)); git_reference_free(ref); assert_has_reflog(true, "refs/heads/foo"); @@ -210,7 +210,7 @@ git_oid_fromstr(&id, current_master_tip); git_reference_ensure_log(g_repo, "refs/tags/foo"); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL)); git_reference_free(ref); assert_has_reflog(true, "refs/tags/foo"); } @@ -228,7 +228,7 @@ /* Move it back */ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL)); git_reference_free(ref); cl_git_pass(git_reflog_read(&log, g_repo, "HEAD")); @@ -250,7 +250,7 @@ cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/heads/master")); cl_git_pass(git_reference_create(&ref2, g_repo, "refs/heads/master", - git_reference_target(ref), 1, NULL, NULL)); + git_reference_target(ref), 1, NULL)); git_reference_free(ref); git_reference_free(ref2); @@ -280,7 +280,7 @@ /* Move it back */ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"); - cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL)); git_reference_free(ref); cl_git_pass(git_reflog_read(&log, g_repo, "HEAD")); diff -Nru libgit2-0.22.2/tests/refs/rename.c libgit2-0.23.1/tests/refs/rename.c --- libgit2-0.22.2/tests/refs/rename.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/rename.c 2015-08-03 18:07:35.000000000 +0000 @@ -22,6 +22,7 @@ void test_refs_rename__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); + cl_git_pass(git_repository_set_ident(g_repo, "me", "foo@example.com")); } void test_refs_rename__cleanup(void) @@ -49,7 +50,7 @@ cl_assert(reference_is_packed(looked_up_ref) == 0); /* Now that the reference is renamed... */ - cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, new_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, new_name, 0, NULL)); cl_assert_equal_s(new_ref->name, new_name); git_reference_free(looked_up_ref); @@ -91,7 +92,7 @@ cl_assert(reference_is_packed(looked_up_ref) != 0); /* Now that the reference is renamed... */ - cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, brand_new_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_ref, looked_up_ref, brand_new_name, 0, NULL)); cl_assert_equal_s(new_ref->name, brand_new_name); git_reference_free(looked_up_ref); @@ -140,7 +141,7 @@ cl_assert(reference_is_packed(looked_up_ref) != 0); /* Now that the reference is renamed... */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, brand_new_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, brand_new_name, 0, NULL)); git_reference_free(looked_up_ref); /* Lookup the other reference */ @@ -166,7 +167,7 @@ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, packed_head_name)); /* Can not be renamed to the name of another existing reference. */ - cl_git_fail(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 0, NULL, NULL)); + cl_git_fail(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 0, NULL)); git_reference_free(looked_up_ref); /* Failure to rename it hasn't corrupted its state */ @@ -187,12 +188,12 @@ /* Can not be renamed with an invalid name. */ cl_assert_equal_i( GIT_EINVALIDSPEC, - git_reference_rename(&renamed_ref, looked_up_ref, "Hello! I'm a very invalid name.", 0, NULL, NULL)); + git_reference_rename(&renamed_ref, looked_up_ref, "Hello! I'm a very invalid name.", 0, NULL)); /* Can not be renamed outside of the refs hierarchy * unless it's ALL_CAPS_AND_UNDERSCORES. */ - cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_rename(&renamed_ref, looked_up_ref, "i-will-sudo-you", 0, NULL, NULL)); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_rename(&renamed_ref, looked_up_ref, "i-will-sudo-you", 0, NULL)); /* Failure to rename it hasn't corrupted its state */ git_reference_free(looked_up_ref); @@ -213,7 +214,7 @@ git_oid_cpy(&oid, git_reference_target(looked_up_ref)); /* Can be force-renamed to the name of another existing reference. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 1, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, packed_test_head_name, 1, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -238,7 +239,7 @@ git_oid_cpy(&oid, git_reference_target(looked_up_ref)); /* Can be force-renamed to the name of another existing reference. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, "refs/heads/test", 1, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, "refs/heads/test", 1, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -268,15 +269,15 @@ git_oid_cpy(&id, git_reference_target(ref)); /* Create loose references */ - cl_git_pass(git_reference_create(&ref_one, g_repo, ref_one_name, &id, 0, NULL, NULL)); - cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref_one, g_repo, ref_one_name, &id, 0, NULL)); + cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL)); /* Pack everything */ cl_git_pass(git_repository_refdb(&refdb, g_repo)); cl_git_pass(git_refdb_compress(refdb)); /* Attempt to create illegal reference */ - cl_git_fail(git_reference_create(&ref_one_new, g_repo, ref_one_name_new, &id, 0, NULL, NULL)); + cl_git_fail(git_reference_create(&ref_one_new, g_repo, ref_one_name_new, &id, 0, NULL)); /* Illegal reference couldn't be created so this is supposed to fail */ cl_git_fail(git_reference_lookup(&ref_one_new, g_repo, ref_one_name_new)); @@ -301,13 +302,13 @@ git_oid_cpy(&id, git_reference_target(ref)); /* Create loose references */ - cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name, &id, 0, NULL)); /* An existing reference... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, ref_two_name)); /* Can be rename to a new name starting with the old name. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name_new, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name_new, 0, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -334,14 +335,14 @@ git_oid_cpy(&id, git_reference_target(ref)); /* Create loose references */ - cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name_new, &id, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref_two, g_repo, ref_two_name_new, &id, 0, NULL)); git_reference_free(ref_two); /* An existing reference... */ cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, ref_two_name_new)); /* Can be renamed upward the reference tree. */ - cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name, 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&renamed_ref, looked_up_ref, ref_two_name, 0, NULL)); git_reference_free(looked_up_ref); git_reference_free(renamed_ref); @@ -361,7 +362,7 @@ cl_git_pass(git_reference_lookup(&ref, g_repo, packed_head_name)); - cl_assert_equal_i(GIT_EEXISTS, git_reference_rename(&new_ref, ref, packed_test_head_name, 0, NULL, NULL)); + cl_assert_equal_i(GIT_EEXISTS, git_reference_rename(&new_ref, ref, packed_test_head_name, 0, NULL)); git_reference_free(ref); } @@ -371,13 +372,10 @@ git_reference *ref, *new_ref; git_reflog *log; const git_reflog_entry *entry; - git_signature *sig; - - cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); cl_git_pass(git_reference_lookup(&ref, g_repo, ref_master_name)); cl_git_pass(git_reference_rename(&new_ref, ref, ref_one_name_new, false, - sig, "message")); + "message")); cl_git_pass(git_reflog_read(&log, g_repo, git_reference_name(new_ref))); entry = git_reflog_entry_byindex(log, 0); cl_assert_equal_s("message", git_reflog_entry_message(entry)); @@ -386,5 +384,4 @@ git_reflog_free(log); git_reference_free(ref); git_reference_free(new_ref); - git_signature_free(sig); } diff -Nru libgit2-0.22.2/tests/refs/revparse.c libgit2-0.23.1/tests/refs/revparse.c --- libgit2-0.22.2/tests/refs/revparse.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/revparse.c 2015-08-03 18:07:35.000000000 +0000 @@ -325,7 +325,7 @@ cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&log_path))); cl_git_pass(git_reference_lookup(&master, repo, "refs/heads/master")); - cl_git_pass(git_reference_rename(&new_master, master, "refs/fakestash", 0, NULL, NULL)); + cl_git_pass(git_reference_rename(&new_master, master, "refs/fakestash", 0, NULL)); git_reference_free(master); cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&log_path))); @@ -597,7 +597,7 @@ "refs/remotes/origin/bim_with_3d@11296", git_reference_target(head), 0, - NULL, NULL)); + NULL)); cl_git_pass(git_revparse_single(&target, repo, "origin/bim_with_3d@11296")); git_object_free(target); @@ -634,7 +634,7 @@ test_object_inrepo("blah-7-gc47800c", "c47800c7266a2be04c571c04d5a6614691ea99bd", repo); cl_git_pass(git_revparse_single(&target, repo, "HEAD~3")); - cl_git_pass(git_branch_create(&branch, repo, "blah-7-gc47800c", (git_commit *)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "blah-7-gc47800c", (git_commit *)target, 0)); git_oid_tostr(sha, GIT_OID_HEXSZ + 1, git_object_id(target)); @@ -672,7 +672,7 @@ test_object_inrepo("a65fedf39aefe402d3bb6e24df4d4f5fe4547750", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", repo); cl_git_pass(git_revparse_single(&target, repo, "HEAD~3")); - cl_git_pass(git_branch_create(&branch, repo, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", (git_commit *)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", (git_commit *)target, 0)); git_oid_tostr(sha, GIT_OID_HEXSZ + 1, git_object_id(target)); @@ -708,7 +708,7 @@ test_object_inrepo("c47800", "c47800c7266a2be04c571c04d5a6614691ea99bd", repo); cl_git_pass(git_revparse_single(&target, repo, "HEAD~3")); - cl_git_pass(git_branch_create(&branch, repo, "c47800", (git_commit *)target, 0, NULL, NULL)); + cl_git_pass(git_branch_create(&branch, repo, "c47800", (git_commit *)target, 0)); git_oid_tostr(sha, GIT_OID_HEXSZ + 1, git_object_id(target)); @@ -812,3 +812,18 @@ "0266163a49e280c4f5ed1e08facd36a2bd716bcf", NULL); } + +void test_refs_revparse__uneven_sizes(void) +{ + test_object("a65fedf39aefe402d3bb6e24df4d4f5fe454775", + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); + + test_object("a65fedf39aefe402d3bb6e24df4d4f5fe45477", + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); + + test_object("a65fedf39aefe402d3bb6e24df4d4f5fe4547", + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); + + test_object("a65fedf39aefe402d3bb6e24df4d", + "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); +} diff -Nru libgit2-0.22.2/tests/refs/settargetwithlog.c libgit2-0.23.1/tests/refs/settargetwithlog.c --- libgit2-0.22.2/tests/refs/settargetwithlog.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/settargetwithlog.c 2015-08-03 18:07:35.000000000 +0000 @@ -25,7 +25,6 @@ { git_reference *reference, *reference_out; git_oid current_id, target_id; - git_signature *signature; git_reflog *reflog; const git_reflog_entry *entry; @@ -36,10 +35,8 @@ cl_git_pass(git_reference_lookup(&reference, g_repo, br2_name)); - cl_git_pass(git_signature_now(&signature, "foo", "foo@bar")); - cl_git_pass(git_reference_set_target( - &reference_out, reference, &target_id, signature, message)); + &reference_out, reference, &target_id, message)); cl_git_pass(git_reflog_read(&reflog, g_repo, br2_name)); @@ -51,5 +48,4 @@ git_reflog_free(reflog); git_reference_free(reference_out); git_reference_free(reference); - git_signature_free(signature); } diff -Nru libgit2-0.22.2/tests/refs/setter.c libgit2-0.23.1/tests/refs/setter.c --- libgit2-0.22.2/tests/refs/setter.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/setter.c 2015-08-03 18:07:35.000000000 +0000 @@ -34,7 +34,7 @@ cl_git_pass(git_reference_lookup(&test_ref, g_repo, ref_test_name)); cl_assert(git_reference_type(test_ref) == GIT_REF_OID); - cl_git_pass(git_reference_set_target(&new_ref, test_ref, &id, NULL, NULL)); + cl_git_pass(git_reference_set_target(&new_ref, test_ref, &id, NULL)); git_reference_free(test_ref); git_reference_free(new_ref); @@ -53,7 +53,7 @@ cl_assert(git_reference_type(head) == GIT_REF_SYMBOLIC); cl_assert(strcmp(git_reference_symbolic_target(head), ref_master_name) == 0); - cl_git_pass(git_reference_symbolic_set_target(&new_head, head, ref_test_name, NULL, NULL)); + cl_git_pass(git_reference_symbolic_set_target(&new_head, head, ref_test_name, NULL)); git_reference_free(new_head); git_reference_free(head); @@ -73,7 +73,7 @@ cl_assert(git_reference_type(ref) == GIT_REF_OID); git_oid_cpy(&id, git_reference_target(ref)); - cl_git_fail(git_reference_symbolic_set_target(&new, ref, ref_name, NULL, NULL)); + cl_git_fail(git_reference_symbolic_set_target(&new, ref, ref_name, NULL)); git_reference_free(ref); } @@ -90,10 +90,10 @@ git_reference_free(ref); /* Create the symbolic ref */ - cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, g_repo, ref_name, ref_master_name, 0, NULL)); /* Can't set an OID on a direct ref */ - cl_git_fail(git_reference_set_target(&new, ref, &id, NULL, NULL)); + cl_git_fail(git_reference_set_target(&new, ref, &id, NULL)); git_reference_free(ref); } diff -Nru libgit2-0.22.2/tests/refs/unicode.c libgit2-0.23.1/tests/refs/unicode.c --- libgit2-0.22.2/tests/refs/unicode.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/unicode.c 2015-08-03 18:07:35.000000000 +0000 @@ -24,7 +24,7 @@ /* Create the reference */ cl_git_pass(git_reference_lookup(&ref0, repo, master)); cl_git_pass(git_reference_create( - &ref1, repo, REFNAME, git_reference_target(ref0), 0, NULL, NULL)); + &ref1, repo, REFNAME, git_reference_target(ref0), 0, NULL)); cl_assert_equal_s(REFNAME, git_reference_name(ref1)); git_reference_free(ref0); diff -Nru libgit2-0.22.2/tests/refs/update.c libgit2-0.23.1/tests/refs/update.c --- libgit2-0.22.2/tests/refs/update.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/refs/update.c 2015-08-03 18:07:35.000000000 +0000 @@ -22,5 +22,5 @@ cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(head)); git_reference_free(head); - cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create(&head, g_repo, GIT_HEAD_FILE, "refs/heads/inv@{id", 1, NULL, NULL)); + cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_symbolic_create(&head, g_repo, GIT_HEAD_FILE, "refs/heads/inv@{id", 1, NULL)); } diff -Nru libgit2-0.22.2/tests/remote/insteadof.c libgit2-0.23.1/tests/remote/insteadof.c --- libgit2-0.22.2/tests/remote/insteadof.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/remote/insteadof.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,72 @@ +#include "clar_libgit2.h" +#include "remote.h" +#include "repository.h" + +#define REPO_PATH "testrepo2/.gitted" +#define REMOTE_ORIGIN "origin" +#define REMOTE_INSTEADOF "insteadof-test" + +static git_repository *g_repo; +static git_remote *g_remote; + +void test_remote_insteadof__initialize(void) +{ + g_repo = NULL; + g_remote = NULL; +} + +void test_remote_insteadof__cleanup(void) +{ + git_repository_free(g_repo); + git_remote_free(g_remote); +} + +void test_remote_insteadof__url_insteadof_not_applicable(void) +{ + cl_git_pass(git_repository_open(&g_repo, cl_fixture(REPO_PATH))); + cl_git_pass(git_remote_lookup(&g_remote, g_repo, REMOTE_ORIGIN)); + + cl_assert_equal_s( + git_remote_url(g_remote), + "https://github.com/libgit2/false.git"); +} + +void test_remote_insteadof__url_insteadof_applicable(void) +{ + cl_git_pass(git_repository_open(&g_repo, cl_fixture(REPO_PATH))); + cl_git_pass(git_remote_lookup(&g_remote, g_repo, REMOTE_INSTEADOF)); + + cl_assert_equal_s( + git_remote_url(g_remote), + "http://github.com/libgit2/libgit2"); +} + +void test_remote_insteadof__pushurl_insteadof_not_applicable(void) +{ + cl_git_pass(git_repository_open(&g_repo, cl_fixture(REPO_PATH))); + cl_git_pass(git_remote_lookup(&g_remote, g_repo, REMOTE_ORIGIN)); + + cl_assert_equal_p(git_remote_pushurl(g_remote), NULL); +} + +void test_remote_insteadof__pushurl_insteadof_applicable(void) +{ + cl_git_pass(git_repository_open(&g_repo, cl_fixture(REPO_PATH))); + cl_git_pass(git_remote_lookup(&g_remote, g_repo, REMOTE_INSTEADOF)); + + cl_assert_equal_s( + git_remote_pushurl(g_remote), + "git@github.com:libgit2/libgit2"); +} + +void test_remote_insteadof__anonymous_remote(void) +{ + cl_git_pass(git_repository_open(&g_repo, cl_fixture(REPO_PATH))); + cl_git_pass(git_remote_create_anonymous(&g_remote, g_repo, + "http://example.com/libgit2/libgit2")); + + cl_assert_equal_s( + git_remote_url(g_remote), + "http://github.com/libgit2/libgit2"); + cl_assert_equal_p(git_remote_pushurl(g_remote), NULL); +} diff -Nru libgit2-0.22.2/tests/repo/head.c libgit2-0.23.1/tests/repo/head.c --- libgit2-0.22.2/tests/repo/head.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/head.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,12 +2,15 @@ #include "refs.h" #include "repo_helpers.h" #include "posix.h" +#include "git2/annotated_commit.h" +static const char *g_email = "foo@example.com"; static git_repository *repo; void test_repo_head__initialize(void) { repo = cl_git_sandbox_init("testrepo.git"); + cl_git_pass(git_repository_set_ident(repo, "Foo Bar", g_email)); } void test_repo_head__cleanup(void) @@ -33,24 +36,20 @@ void test_repo_head__head_detached(void) { git_reference *ref; - git_signature *sig; - - cl_git_pass(git_signature_now(&sig, "Foo Bar", "foo@example.com")); cl_assert_equal_i(false, git_repository_head_detached(repo)); - cl_git_pass(git_repository_detach_head(repo, sig, "CABLE DETACHED")); - check_last_reflog_entry(sig->email, "CABLE DETACHED"); + cl_git_pass(git_repository_detach_head(repo)); + check_last_reflog_entry(g_email, "checkout: moving from master to a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); cl_assert_equal_i(true, git_repository_head_detached(repo)); /* take the repo back to it's original state */ cl_git_pass(git_reference_symbolic_create(&ref, repo, "HEAD", "refs/heads/master", - true, sig, "REATTACH")); + true, "REATTACH")); git_reference_free(ref); - check_last_reflog_entry(sig->email, "REATTACH"); + check_last_reflog_entry(g_email, "REATTACH"); cl_assert_equal_i(false, git_repository_head_detached(repo)); - git_signature_free(sig); } void test_repo_head__unborn_head(void) @@ -65,7 +64,7 @@ /* take the repo back to it's original state */ - cl_git_pass(git_reference_symbolic_create(&ref, repo, "HEAD", "refs/heads/master", 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&ref, repo, "HEAD", "refs/heads/master", 1, NULL)); cl_assert(git_repository_head_unborn(repo) == 0); git_reference_free(ref); @@ -75,7 +74,7 @@ { git_reference *head; - cl_git_pass(git_repository_set_head(repo, "refs/heads/doesnt/exist/yet", NULL, NULL)); + cl_git_pass(git_repository_set_head(repo, "refs/heads/doesnt/exist/yet")); cl_assert_equal_i(false, git_repository_head_detached(repo)); @@ -84,19 +83,19 @@ void test_repo_head__set_head_Returns_ENOTFOUND_when_the_reference_doesnt_exist(void) { - cl_assert_equal_i(GIT_ENOTFOUND, git_repository_set_head(repo, "refs/tags/doesnt/exist/yet", NULL, NULL)); + cl_assert_equal_i(GIT_ENOTFOUND, git_repository_set_head(repo, "refs/tags/doesnt/exist/yet")); } void test_repo_head__set_head_Fails_when_the_reference_points_to_a_non_commitish(void) { - cl_git_fail(git_repository_set_head(repo, "refs/tags/point_to_blob", NULL, NULL)); + cl_git_fail(git_repository_set_head(repo, "refs/tags/point_to_blob")); } void test_repo_head__set_head_Attaches_HEAD_when_the_reference_points_to_a_branch(void) { git_reference *head; - cl_git_pass(git_repository_set_head(repo, "refs/heads/br2", NULL, NULL)); + cl_git_pass(git_repository_set_head(repo, "refs/heads/br2")); cl_assert_equal_i(false, git_repository_head_detached(repo)); @@ -123,7 +122,7 @@ void test_repo_head__set_head_Detaches_HEAD_when_the_reference_doesnt_point_to_a_branch(void) { - cl_git_pass(git_repository_set_head(repo, "refs/tags/test", NULL, NULL)); + cl_git_pass(git_repository_set_head(repo, "refs/tags/test")); cl_assert_equal_i(true, git_repository_head_detached(repo)); @@ -136,7 +135,7 @@ cl_git_pass(git_oid_fromstr(&oid, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef")); - cl_assert_equal_i(GIT_ENOTFOUND, git_repository_set_head_detached(repo, &oid, NULL, NULL)); + cl_assert_equal_i(GIT_ENOTFOUND, git_repository_set_head_detached(repo, &oid)); } void test_repo_head__set_head_detached_Fails_when_the_object_isnt_a_commitish(void) @@ -145,7 +144,7 @@ cl_git_pass(git_revparse_single(&blob, repo, "point_to_blob")); - cl_git_fail(git_repository_set_head_detached(repo, git_object_id(blob), NULL, NULL)); + cl_git_fail(git_repository_set_head_detached(repo, git_object_id(blob))); git_object_free(blob); } @@ -157,7 +156,7 @@ cl_git_pass(git_revparse_single(&tag, repo, "tags/test")); cl_assert_equal_i(GIT_OBJ_TAG, git_object_type(tag)); - cl_git_pass(git_repository_set_head_detached(repo, git_object_id(tag), NULL, NULL)); + cl_git_pass(git_repository_set_head_detached(repo, git_object_id(tag))); assert_head_is_correctly_detached(); @@ -168,7 +167,7 @@ { cl_assert_equal_i(false, git_repository_head_detached(repo)); - cl_git_pass(git_repository_detach_head(repo, NULL, NULL)); + cl_git_pass(git_repository_detach_head(repo)); assert_head_is_correctly_detached(); } @@ -177,9 +176,9 @@ { git_reference *head; - cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, "refs/tags/point_to_blob", 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, "refs/tags/point_to_blob", 1, NULL)); - cl_git_fail(git_repository_detach_head(repo, NULL, NULL)); + cl_git_fail(git_repository_detach_head(repo)); git_reference_free(head); } @@ -188,7 +187,7 @@ { make_head_unborn(repo, NON_EXISTING_HEAD); - cl_assert_equal_i(GIT_EUNBORNBRANCH, git_repository_detach_head(repo, NULL, NULL)); + cl_assert_equal_i(GIT_EUNBORNBRANCH, git_repository_detach_head(repo)); } void test_repo_head__retrieving_an_unborn_branch_returns_GIT_EUNBORNBRANCH(void) @@ -253,19 +252,26 @@ { git_object *tag; git_signature *sig; + git_annotated_commit *annotated; cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); - cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked", sig, "message1")); - cl_git_pass(git_repository_set_head(repo, "refs/heads/unborn", sig, "message2")); + cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked")); + cl_git_pass(git_repository_set_head(repo, "refs/heads/unborn")); cl_git_pass(git_revparse_single(&tag, repo, "tags/test")); - cl_git_pass(git_repository_set_head_detached(repo, git_object_id(tag), sig, "message3")); - cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked", sig, "message4")); + cl_git_pass(git_repository_set_head_detached(repo, git_object_id(tag))); + cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked")); + + test_reflog(repo, 2, NULL, "refs/heads/haacked", "foo@example.com", "checkout: moving from master to haacked"); + test_reflog(repo, 1, NULL, "tags/test^{commit}", "foo@example.com", "checkout: moving from unborn to e90810b8df3e80c413d903f631643c716887138d"); + test_reflog(repo, 0, "tags/test^{commit}", "refs/heads/haacked", "foo@example.com", "checkout: moving from e90810b8df3e80c413d903f631643c716887138d to haacked"); + + cl_git_pass(git_annotated_commit_from_revspec(&annotated, repo, "haacked~0")); + cl_git_pass(git_repository_set_head_detached_from_annotated(repo, annotated)); - test_reflog(repo, 2, NULL, "refs/heads/haacked", "foo@example.com", "message1"); - test_reflog(repo, 1, NULL, "tags/test^{commit}", "foo@example.com", "message3"); - test_reflog(repo, 0, "tags/test^{commit}", "refs/heads/haacked", "foo@example.com", "message4"); + test_reflog(repo, 0, NULL, "refs/heads/haacked", "foo@example.com", "checkout: moving from haacked to haacked~0"); + git_annotated_commit_free(annotated); git_object_free(tag); git_signature_free(sig); } @@ -299,14 +305,14 @@ cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); - msg = "message1"; + msg = "checkout: moving from master to e90810b8df3e80c413d903f631643c716887138d"; git_oid_fromstr(&id, "e90810b8df3e80c413d903f631643c716887138d"); - cl_git_pass(git_repository_set_head_detached(repo, &id, sig, msg)); + cl_git_pass(git_repository_set_head_detached(repo, &id)); assert_head_reflog(repo, 0, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", "e90810b8df3e80c413d903f631643c716887138d", msg); - msg = "message2"; - cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked", sig, msg)); + msg = "checkout: moving from e90810b8df3e80c413d903f631643c716887138d to haacked"; + cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked")); assert_head_reflog(repo, 0, "e90810b8df3e80c413d903f631643c716887138d", "258f0e2a959a364e40ed6603d5d44fbb24765b10", msg); @@ -315,37 +321,30 @@ void test_repo_head__orphan_branch_does_not_count(void) { - git_signature *sig; git_oid id; const char *msg; - cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); - /* Have something known */ - msg = "message1"; + msg = "checkout: moving from master to e90810b8df3e80c413d903f631643c716887138d"; git_oid_fromstr(&id, "e90810b8df3e80c413d903f631643c716887138d"); - cl_git_pass(git_repository_set_head_detached(repo, &id, sig, msg)); + cl_git_pass(git_repository_set_head_detached(repo, &id)); assert_head_reflog(repo, 0, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", "e90810b8df3e80c413d903f631643c716887138d", msg); /* Switching to an orphan branch does not write tot he reflog */ - cl_git_pass(git_repository_set_head(repo, "refs/heads/orphan", sig, "ignored message")); + cl_git_pass(git_repository_set_head(repo, "refs/heads/orphan")); assert_head_reflog(repo, 0, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", "e90810b8df3e80c413d903f631643c716887138d", msg); /* And coming back, we set the source to zero */ - msg = "message2"; - cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked", sig, msg)); + msg = "checkout: moving from orphan to haacked"; + cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked")); assert_head_reflog(repo, 0, "0000000000000000000000000000000000000000", "258f0e2a959a364e40ed6603d5d44fbb24765b10", msg); - - git_signature_free(sig); } void test_repo_head__set_to_current_target(void) { - git_signature *sig; - const char *msg; git_reflog *log; size_t nentries, nentries_after; @@ -353,20 +352,14 @@ nentries = git_reflog_entrycount(log); git_reflog_free(log); - cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); - - msg = "message 1"; - cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked", sig, msg)); - cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked", sig, msg)); + cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked")); + cl_git_pass(git_repository_set_head(repo, "refs/heads/haacked")); cl_git_pass(git_reflog_read(&log, repo, GIT_HEAD_FILE)); nentries_after = git_reflog_entrycount(log); git_reflog_free(log); cl_assert_equal_i(nentries + 1, nentries_after); - - git_signature_free(sig); - } void test_repo_head__branch_birth(void) @@ -389,8 +382,7 @@ cl_git_pass(git_reference_peel((git_object **) &tree, ref, GIT_OBJ_TREE)); git_reference_free(ref); - msg = "message 1"; - cl_git_pass(git_repository_set_head(repo, "refs/heads/orphan", sig, msg)); + cl_git_pass(git_repository_set_head(repo, "refs/heads/orphan")); cl_git_pass(git_reflog_read(&log, repo, GIT_HEAD_FILE)); nentries_after = git_reflog_entrycount(log); @@ -449,7 +441,7 @@ nentries_master = entrycount(repo, "refs/heads/master"); msg = "message 1"; - cl_git_pass(git_reference_symbolic_create(&ref, repo, "refs/heads/master", "refs/heads/foo", 1, sig, msg)); + cl_git_pass(git_reference_symbolic_create(&ref, repo, "refs/heads/master", "refs/heads/foo", 1, msg)); git_reference_free(ref); cl_assert_equal_i(0, entrycount(repo, "refs/heads/foo")); diff -Nru libgit2-0.22.2/tests/repo/headtree.c libgit2-0.23.1/tests/repo/headtree.c --- libgit2-0.22.2/tests/repo/headtree.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/headtree.c 2015-08-03 18:07:35.000000000 +0000 @@ -20,7 +20,7 @@ void test_repo_headtree__can_retrieve_the_root_tree_from_a_detached_head(void) { - cl_git_pass(git_repository_detach_head(repo, NULL, NULL)); + cl_git_pass(git_repository_detach_head(repo)); cl_git_pass(git_repository_head_tree(&tree, repo)); diff -Nru libgit2-0.22.2/tests/repo/init.c libgit2-0.23.1/tests/repo/init.c --- libgit2-0.22.2/tests/repo/init.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/init.c 2015-08-03 18:07:35.000000000 +0000 @@ -3,6 +3,7 @@ #include "repository.h" #include "config.h" #include "path.h" +#include "config/config_helpers.h" enum repo_mode { STANDARD_REPOSITORY = 0, @@ -370,8 +371,6 @@ void test_repo_init__relative_gitdir(void) { git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; - git_config *cfg; - const char *worktree_path; git_buf dot_git_content = GIT_BUF_INIT; opts.workdir_path = "../c_wd"; @@ -391,24 +390,19 @@ /* Verify that the gitlink and worktree entries are relative */ /* Verify worktree */ - cl_git_pass(git_repository_config(&cfg, _repo)); - cl_git_pass(git_config_get_string(&worktree_path, cfg, "core.worktree")); - cl_assert_equal_s("../c_wd/", worktree_path); + assert_config_entry_value(_repo, "core.worktree", "../c_wd/"); /* Verify gitlink */ cl_git_pass(git_futils_readbuffer(&dot_git_content, "root/b/c_wd/.git")); cl_assert_equal_s("gitdir: ../my_repository/", dot_git_content.ptr); git_buf_free(&dot_git_content); - git_config_free(cfg); cleanup_repository("root"); } void test_repo_init__relative_gitdir_2(void) { git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT; - git_config *cfg; - const char *worktree_path; git_buf dot_git_content = GIT_BUF_INIT; git_buf full_path = GIT_BUF_INIT; @@ -433,16 +427,13 @@ /* Verify that the gitlink and worktree entries are relative */ /* Verify worktree */ - cl_git_pass(git_repository_config(&cfg, _repo)); - cl_git_pass(git_config_get_string(&worktree_path, cfg, "core.worktree")); - cl_assert_equal_s("../c_wd/", worktree_path); + assert_config_entry_value(_repo, "core.worktree", "../c_wd/"); /* Verify gitlink */ cl_git_pass(git_futils_readbuffer(&dot_git_content, "root/b/c_wd/.git")); cl_assert_equal_s("gitdir: ../my_repository/", dot_git_content.ptr); git_buf_free(&dot_git_content); - git_config_free(cfg); cleanup_repository("root"); } @@ -722,7 +713,7 @@ git_buf root = GIT_BUF_INIT; int root_len; - if (!cl_getenv("GITTEST_INVASIVE_FILESYSTEM")) + if (!cl_getenv("GITTEST_INVASIVE_FS_STRUCTURE")) cl_skip(); root_len = git_path_root(sandbox); diff -Nru libgit2-0.22.2/tests/repo/iterator.c libgit2-0.23.1/tests/repo/iterator.c --- libgit2-0.22.2/tests/repo/iterator.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/iterator.c 2015-08-03 18:07:35.000000000 +0000 @@ -906,6 +906,7 @@ static const char *expect_base[] = { "heads/br2", "heads/dir", + "heads/ident", "heads/long-file-name", "heads/master", "heads/packed-test", @@ -923,11 +924,11 @@ cl_git_pass(git_iterator_for_filesystem( &i, "testrepo/.git/refs", 0, NULL, NULL)); - expect_iterator_items(i, 12, expect_base, 12, expect_base); + expect_iterator_items(i, 13, expect_base, 13, expect_base); git_iterator_free(i); } -void test_repo_iterator__fs_preserves_error(void) +void test_repo_iterator__unreadable_dir(void) { git_iterator *i; const git_index_entry *e; @@ -950,10 +951,6 @@ cl_git_pass(git_iterator_advance(&e, i)); /* a */ cl_git_fail(git_iterator_advance(&e, i)); /* b */ - cl_assert(giterr_last()); - cl_assert(giterr_last()->message != NULL); - /* skip 'c/' empty directory */ - cl_git_pass(git_iterator_advance(&e, i)); /* d */ cl_assert_equal_i(GIT_ITEROVER, git_iterator_advance(&e, i)); cl_must_pass(p_chmod("empty_standard_repo/r/b", 0777)); diff -Nru libgit2-0.22.2/tests/repo/new.c libgit2-0.23.1/tests/repo/new.c --- libgit2-0.22.2/tests/repo/new.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/repo/new.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,27 @@ +#include "clar_libgit2.h" +#include "git2/sys/repository.h" + +void test_repo_new__has_nothing(void) +{ + git_repository *repo; + + cl_git_pass(git_repository_new(&repo)); + cl_assert_equal_b(true, git_repository_is_bare(repo)); + cl_assert_equal_p(NULL, git_repository_path(repo)); + cl_assert_equal_p(NULL, git_repository_workdir(repo)); + git_repository_free(repo); +} + +void test_repo_new__is_bare_until_workdir_set(void) +{ + git_repository *repo; + + cl_git_pass(git_repository_new(&repo)); + cl_assert_equal_b(true, git_repository_is_bare(repo)); + + cl_git_pass(git_repository_set_workdir(repo, clar_sandbox_path(), 0)); + cl_assert_equal_b(false, git_repository_is_bare(repo)); + + git_repository_free(repo); +} + diff -Nru libgit2-0.22.2/tests/repo/open.c libgit2-0.23.1/tests/repo/open.c --- libgit2-0.22.2/tests/repo/open.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/open.c 2015-08-03 18:07:35.000000000 +0000 @@ -20,6 +20,23 @@ cl_assert(git_repository_workdir(repo) == NULL); } +void test_repo_open__format_version_1(void) +{ + git_repository *repo; + git_config *config; + + repo = cl_git_sandbox_init("empty_bare.git"); + + cl_git_pass(git_repository_open(&repo, "empty_bare.git")); + cl_git_pass(git_repository_config(&config, repo)); + + cl_git_pass(git_config_set_int32(config, "core.repositoryformatversion", 1)); + + git_config_free(config); + git_repository_free(repo); + cl_git_fail(git_repository_open(&repo, "empty_bare.git")); +} + void test_repo_open__standard_empty_repo_through_gitdir(void) { git_repository *repo; diff -Nru libgit2-0.22.2/tests/repo/repo_helpers.c libgit2-0.23.1/tests/repo/repo_helpers.c --- libgit2-0.22.2/tests/repo/repo_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/repo_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -7,7 +7,7 @@ { git_reference *head; - cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, target, 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, repo, GIT_HEAD_FILE, target, 1, NULL)); git_reference_free(head); } diff -Nru libgit2-0.22.2/tests/repo/reservedname.c libgit2-0.23.1/tests/repo/reservedname.c --- libgit2-0.22.2/tests/repo/reservedname.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/repo/reservedname.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,108 @@ +#include "clar_libgit2.h" +#include "../submodule/submodule_helpers.h" +#include "repository.h" + +void test_repo_reservedname__cleanup(void) +{ + cl_git_sandbox_cleanup(); +} + +void test_repo_reservedname__includes_shortname_on_win32(void) +{ + git_repository *repo; + git_buf *reserved; + size_t reserved_len; + + repo = cl_git_sandbox_init("nasty"); + cl_assert(git_repository__reserved_names(&reserved, &reserved_len, repo, false)); + +#ifdef GIT_WIN32 + cl_assert_equal_i(2, reserved_len); + cl_assert_equal_s(".git", reserved[0].ptr); + cl_assert_equal_s("GIT~1", reserved[1].ptr); +#else + cl_assert_equal_i(1, reserved_len); + cl_assert_equal_s(".git", reserved[0].ptr); +#endif +} + +void test_repo_reservedname__includes_shortname_when_requested(void) +{ + git_repository *repo; + git_buf *reserved; + size_t reserved_len; + + repo = cl_git_sandbox_init("nasty"); + cl_assert(git_repository__reserved_names(&reserved, &reserved_len, repo, true)); + + cl_assert_equal_i(2, reserved_len); + cl_assert_equal_s(".git", reserved[0].ptr); + cl_assert_equal_s("GIT~1", reserved[1].ptr); +} + +/* Ensures that custom shortnames are included: creates a GIT~1 so that the + * .git folder itself will have to be named GIT~2 + */ +void test_repo_reservedname__custom_shortname_recognized(void) +{ +#ifdef GIT_WIN32 + git_repository *repo; + git_buf *reserved; + size_t reserved_len; + + if (!cl_sandbox_supports_8dot3()) + clar__skip(); + + repo = cl_git_sandbox_init("nasty"); + + cl_must_pass(p_rename("nasty/.git", "nasty/_temp")); + cl_git_write2file("nasty/git~1", "", 0, O_RDWR|O_CREAT, 0666); + cl_must_pass(p_rename("nasty/_temp", "nasty/.git")); + + cl_assert(git_repository__reserved_names(&reserved, &reserved_len, repo, true)); + + cl_assert_equal_i(3, reserved_len); + cl_assert_equal_s(".git", reserved[0].ptr); + cl_assert_equal_s("GIT~1", reserved[1].ptr); + cl_assert_equal_s("GIT~2", reserved[2].ptr); +#endif +} + +/* When looking at the short name for a submodule, we need to prevent + * people from overwriting the `.git` file in the submodule working + * directory itself. We don't want to look at the actual repository + * path, since it will be in the super's repository above us, and + * typically named with the name of our subrepository. Consequently, + * preventing access to the short name of the actual repository path + * would prevent us from creating files with the same name as the + * subrepo. (Eg, a submodule named "libgit2" could not contain a file + * named "libgit2", which would be unfortunate.) + */ +void test_repo_reservedname__submodule_pointer(void) +{ +#ifdef GIT_WIN32 + git_repository *super_repo, *sub_repo; + git_submodule *sub; + git_buf *sub_reserved; + size_t sub_reserved_len; + + if (!cl_sandbox_supports_8dot3()) + clar__skip(); + + super_repo = setup_fixture_submod2(); + + assert_submodule_exists(super_repo, "sm_unchanged"); + + cl_git_pass(git_submodule_lookup(&sub, super_repo, "sm_unchanged")); + cl_git_pass(git_submodule_open(&sub_repo, sub)); + + cl_assert(git_repository__reserved_names(&sub_reserved, &sub_reserved_len, sub_repo, true)); + + cl_assert_equal_i(2, sub_reserved_len); + cl_assert_equal_s(".git", sub_reserved[0].ptr); + cl_assert_equal_s("GIT~1", sub_reserved[1].ptr); + + git_submodule_free(sub); + git_repository_free(sub_repo); +#endif +} diff -Nru libgit2-0.22.2/tests/repo/setters.c libgit2-0.23.1/tests/repo/setters.c --- libgit2-0.22.2/tests/repo/setters.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/setters.c 2015-08-03 18:07:35.000000000 +0000 @@ -46,7 +46,7 @@ void test_repo_setters__setting_a_workdir_creates_a_gitlink(void) { git_config *cfg; - const char *val; + git_buf buf = GIT_BUF_INIT; git_buf content = GIT_BUF_INIT; cl_git_pass(git_repository_set_workdir(repo, "./new_workdir", true)); @@ -59,8 +59,10 @@ git_buf_free(&content); cl_git_pass(git_repository_config(&cfg, repo)); - cl_git_pass(git_config_get_string(&val, cfg, "core.worktree")); - cl_assert(git__suffixcmp(val, "new_workdir/") == 0); + cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.worktree")); + cl_assert(git__suffixcmp(git_buf_cstr(&buf), "new_workdir/") == 0); + + git_buf_free(&buf); git_config_free(cfg); } diff -Nru libgit2-0.22.2/tests/repo/state.c libgit2-0.23.1/tests/repo/state.c --- libgit2-0.22.2/tests/repo/state.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/repo/state.c 2015-08-03 18:07:35.000000000 +0000 @@ -37,7 +37,7 @@ void test_repo_state__none_with_HEAD_detached(void) { - cl_git_pass(git_repository_detach_head(_repo, NULL, NULL)); + cl_git_pass(git_repository_detach_head(_repo)); assert_repo_state(GIT_REPOSITORY_STATE_NONE); } diff -Nru libgit2-0.22.2/tests/reset/hard.c libgit2-0.23.1/tests/reset/hard.c --- libgit2-0.22.2/tests/reset/hard.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/reset/hard.c 2015-08-03 18:07:35.000000000 +0000 @@ -71,7 +71,7 @@ cl_git_pass(git_revparse_single(&target, repo, "26a125e")); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); for (i = 0; i < 4; ++i) { cl_git_pass(git_buf_joinpath(&path, wd, files[i])); @@ -96,7 +96,7 @@ cl_git_pass(git_revparse_single(&target, bare, KNOWN_COMMIT_IN_BARE_REPO)); - cl_assert_equal_i(GIT_EBAREREPO, git_reset(bare, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_assert_equal_i(GIT_EBAREREPO, git_reset(bare, target, GIT_RESET_HARD, NULL)); git_repository_free(bare); } @@ -108,7 +108,7 @@ memset(&entry, 0x0, sizeof(git_index_entry)); entry.path = "conflicting_file"; - entry.flags = (side << GIT_IDXENTRY_STAGESHIFT); + GIT_IDXENTRY_STAGE_SET(&entry, side); entry.mode = 0100644; git_oid_cpy(&entry.id, oid); @@ -152,7 +152,7 @@ cl_git_pass(git_index_write(index)); cl_git_pass(git_revparse_single(&target, repo, "26a125e")); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); cl_assert(git_path_exists("status/conflicting_file") == 0); @@ -183,7 +183,7 @@ cl_git_mkfile(git_buf_cstr(&orig_head_path), "0017bd4ab1ec30440b17bae1680cff124ab5f1f6"); cl_git_pass(git_revparse_single(&target, repo, "0017bd4")); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); cl_assert(!git_path_exists(git_buf_cstr(&merge_head_path))); cl_assert(!git_path_exists(git_buf_cstr(&merge_msg_path))); @@ -200,6 +200,8 @@ void test_reset_hard__reflog_is_correct(void) { + git_buf buf = GIT_BUF_INIT; + git_annotated_commit *annotated; const char *exp_msg = "commit: Add a file which name should appear before the " "\"subdir/\" folder while being dealt with by the treewalker"; @@ -208,25 +210,28 @@ /* Branch not moving, no reflog entry */ cl_git_pass(git_revparse_single(&target, repo, "HEAD^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); reflog_check(repo, "HEAD", 3, "emeric.fermas@gmail.com", exp_msg); reflog_check(repo, "refs/heads/master", 3, "emeric.fermas@gmail.com", exp_msg); git_object_free(target); - /* Moved branch, expect default message */ - exp_msg = "reset: moving"; + /* Moved branch, expect id in message */ cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, NULL)); - reflog_check(repo, "HEAD", 4, NULL, exp_msg); - reflog_check(repo, "refs/heads/master", 4, NULL, exp_msg); - - git_object_free(target); - - /* Moved branch, expect custom message */ - exp_msg = "message1"; - cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL, "message1")); + cl_git_pass(git_buf_printf(&buf, "reset: moving to %s", git_oid_tostr_s(git_object_id(target)))); + cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL)); + reflog_check(repo, "HEAD", 4, NULL, git_buf_cstr(&buf)); + reflog_check(repo, "refs/heads/master", 4, NULL, git_buf_cstr(&buf)); + + git_buf_free(&buf); + + /* Moved branch, expect revspec in message */ + exp_msg = "reset: moving to HEAD~^{commit}"; + cl_git_pass(git_annotated_commit_from_revspec(&annotated, repo, "HEAD~^{commit}")); + cl_git_pass(git_reset_from_annotated(repo, annotated, GIT_RESET_HARD, NULL)); reflog_check(repo, "HEAD", 5, NULL, exp_msg); reflog_check(repo, "refs/heads/master", 5, NULL, exp_msg); + + git_annotated_commit_free(annotated); + } diff -Nru libgit2-0.22.2/tests/reset/mixed.c libgit2-0.23.1/tests/reset/mixed.c --- libgit2-0.22.2/tests/reset/mixed.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/reset/mixed.c 2015-08-03 18:07:35.000000000 +0000 @@ -29,7 +29,7 @@ cl_git_pass(git_revparse_single(&target, bare, KNOWN_COMMIT_IN_BARE_REPO)); - cl_assert_equal_i(GIT_EBAREREPO, git_reset(bare, target, GIT_RESET_MIXED, NULL, NULL, NULL)); + cl_assert_equal_i(GIT_EBAREREPO, git_reset(bare, target, GIT_RESET_MIXED, NULL)); git_repository_free(bare); } @@ -42,7 +42,7 @@ cl_assert(status == GIT_STATUS_CURRENT); cl_git_pass(git_revparse_single(&target, repo, "605812a")); - cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL)); cl_git_pass(git_status_file(&status, repo, "macro_bad")); cl_assert(status == GIT_STATUS_WT_NEW); @@ -50,6 +50,8 @@ void test_reset_mixed__reflog_is_correct(void) { + git_buf buf = GIT_BUF_INIT; + git_annotated_commit *annotated; const char *exp_msg = "commit: Updating test data so we can test inter-hunk-context"; reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg); @@ -57,27 +59,27 @@ /* Branch not moving, no reflog entry */ cl_git_pass(git_revparse_single(&target, repo, "HEAD^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL)); reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg); reflog_check(repo, "refs/heads/master", 9, "yoram.harmelin@gmail.com", exp_msg); git_object_free(target); target = NULL; - /* Moved branch, expect default message */ - exp_msg = "reset: moving"; + /* Moved branch, expect id in message */ cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL, NULL)); - reflog_check(repo, "HEAD", 10, NULL, exp_msg); - reflog_check(repo, "refs/heads/master", 10, NULL, exp_msg); - - git_object_free(target); - target = NULL; - - /* Moved branch, expect custom message */ - exp_msg = "message1"; - cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL, "message1")); + git_buf_clear(&buf); + cl_git_pass(git_buf_printf(&buf, "reset: moving to %s", git_oid_tostr_s(git_object_id(target)))); + cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL)); + reflog_check(repo, "HEAD", 10, NULL, git_buf_cstr(&buf)); + reflog_check(repo, "refs/heads/master", 10, NULL, git_buf_cstr(&buf)); + git_buf_free(&buf); + + /* Moved branch, expect revspec in message */ + exp_msg = "reset: moving to HEAD~^{commit}"; + cl_git_pass(git_annotated_commit_from_revspec(&annotated, repo, "HEAD~^{commit}")); + cl_git_pass(git_reset_from_annotated(repo, annotated, GIT_RESET_MIXED, NULL)); reflog_check(repo, "HEAD", 11, NULL, exp_msg); reflog_check(repo, "refs/heads/master", 11, NULL, exp_msg); + git_annotated_commit_free(annotated); } diff -Nru libgit2-0.22.2/tests/reset/reset_helpers.c libgit2-0.23.1/tests/reset/reset_helpers.c --- libgit2-0.22.2/tests/reset/reset_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/reset/reset_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -7,12 +7,12 @@ git_reflog *log; const git_reflog_entry *entry; + GIT_UNUSED(exp_email); + cl_git_pass(git_reflog_read(&log, repo, refname)); cl_assert_equal_i(exp_count, git_reflog_entrycount(log)); entry = git_reflog_entry_byindex(log, 0); - if (exp_email) - cl_assert_equal_s(exp_email, git_reflog_entry_committer(entry)->email); if (exp_msg) cl_assert_equal_s(exp_msg, git_reflog_entry_message(entry)); diff -Nru libgit2-0.22.2/tests/reset/soft.c libgit2-0.23.1/tests/reset/soft.c --- libgit2-0.22.2/tests/reset/soft.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/reset/soft.c 2015-08-03 18:07:35.000000000 +0000 @@ -30,7 +30,7 @@ cl_assert(git_repository_head_detached(repo) == should_be_detached); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); cl_assert(git_repository_head_detached(repo) == should_be_detached); @@ -45,7 +45,7 @@ void test_reset_soft__can_reset_the_detached_Head_to_the_specified_commit(void) { - git_repository_detach_head(repo, NULL, NULL); + git_repository_detach_head(repo); assert_reset_soft(true); } @@ -61,7 +61,7 @@ cl_git_pass(git_revparse_single(&target, repo, raw_head_oid)); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); cl_git_pass(git_reference_name_to_id(&oid, repo, "HEAD")); cl_git_pass(git_oid_streq(&oid, raw_head_oid)); @@ -74,7 +74,7 @@ /* b25fa35 is a tag, pointing to another tag which points to commit e90810b */ cl_git_pass(git_revparse_single(&target, repo, "b25fa35")); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); cl_assert(git_repository_head_detached(repo) == false); cl_git_pass(git_reference_name_to_id(&oid, repo, "HEAD")); @@ -86,12 +86,12 @@ /* 53fc32d is the tree of commit e90810b */ cl_git_pass(git_revparse_single(&target, repo, "53fc32d")); - cl_git_fail(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_fail(git_reset(repo, target, GIT_RESET_SOFT, NULL)); git_object_free(target); /* 521d87c is an annotated tag pointing to a blob */ cl_git_pass(git_revparse_single(&target, repo, "521d87c")); - cl_git_fail(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_fail(git_reset(repo, target, GIT_RESET_SOFT, NULL)); } void test_reset_soft__resetting_against_an_unborn_head_repo_makes_the_head_no_longer_unborn(void) @@ -104,7 +104,7 @@ cl_assert_equal_i(true, git_repository_head_unborn(repo)); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); cl_assert_equal_i(false, git_repository_head_unborn(repo)); @@ -118,13 +118,13 @@ { git_buf merge_head_path = GIT_BUF_INIT; - cl_git_pass(git_repository_detach_head(repo, NULL, NULL)); + cl_git_pass(git_repository_detach_head(repo)); cl_git_pass(git_buf_joinpath(&merge_head_path, git_repository_path(repo), "MERGE_HEAD")); cl_git_mkfile(git_buf_cstr(&merge_head_path), "beefbeefbeefbeefbeefbeefbeefbeefbeefbeef\n"); cl_git_pass(git_revparse_single(&target, repo, KNOWN_COMMIT_IN_BARE_REPO)); - cl_assert_equal_i(GIT_EUNMERGED, git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_assert_equal_i(GIT_EUNMERGED, git_reset(repo, target, GIT_RESET_SOFT, NULL)); cl_git_pass(p_unlink(git_buf_cstr(&merge_head_path))); git_buf_free(&merge_head_path); @@ -152,31 +152,38 @@ cl_git_pass(git_reference_peel(&target, head, GIT_OBJ_COMMIT)); git_reference_free(head); - cl_assert_equal_i(GIT_EUNMERGED, git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_assert_equal_i(GIT_EUNMERGED, git_reset(repo, target, GIT_RESET_SOFT, NULL)); } -void test_reset_soft_reflog_is_correct(void) +void test_reset_soft__reflog_is_correct(void) { - const char *exp_msg = "commit: Updating test data so we can test inter-hunk-context"; + git_annotated_commit *annotated; + const char *exp_msg = "checkout: moving from br2 to master"; + const char *master_msg = "commit: checking in"; - reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg); - reflog_check(repo, "refs/heads/master", 9, "yoram.harmelin@gmail.com", exp_msg); + reflog_check(repo, "HEAD", 7, "yoram.harmelin@gmail.com", exp_msg); + reflog_check(repo, "refs/heads/master", 2, "yoram.harmelin@gmail.com", master_msg); /* Branch not moving, no reflog entry */ cl_git_pass(git_revparse_single(&target, repo, "HEAD^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); - reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg); - reflog_check(repo, "refs/heads/master", 9, "yoram.harmelin@gmail.com", exp_msg); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); + reflog_check(repo, "HEAD", 7, "yoram.harmelin@gmail.com", exp_msg); + reflog_check(repo, "refs/heads/master", 2, "yoram.harmelin@gmail.com", master_msg); + git_object_free(target); - /* Moved branch, expect default message */ + /* Moved branch, expect id in message */ + exp_msg = "reset: moving to be3563ae3f795b2b4353bcce3a527ad0a4f7f644"; cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL)); + reflog_check(repo, "HEAD", 8, "yoram.harmelin@gmail.com", exp_msg); + reflog_check(repo, "refs/heads/master", 3, NULL, exp_msg); + + /* Moved branch, expect message with annotated string */ + exp_msg = "reset: moving to HEAD~^{commit}"; + cl_git_pass(git_annotated_commit_from_revspec(&annotated, repo, "HEAD~^{commit}")); + cl_git_pass(git_reset_from_annotated(repo, annotated, GIT_RESET_SOFT, NULL)); reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg); - reflog_check(repo, "refs/heads/master", 10, NULL, "reset: moving"); + reflog_check(repo, "refs/heads/master", 4, NULL, exp_msg); - /* Moved branch, expect custom message */ - cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}")); - cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL, "message1")); - reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg); - reflog_check(repo, "refs/heads/master", 11, NULL, "message1"); + git_annotated_commit_free(annotated); } Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/index and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/index differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/09/7722be9b67b48dfe3b19396d02fd535300ee46 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/09/7722be9b67b48dfe3b19396d02fd535300ee46 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/0e/052888828a954ca17e5882638e3c6a083e75c0 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/0e/052888828a954ca17e5882638e3c6a083e75c0 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/16/78031ee023a23bd3515e4e1693b661a69f0a73 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/16/78031ee023a23bd3515e4e1693b661a69f0a73 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/16/c72b67861f8524a5bebc05cd20472d3fca00da and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/16/c72b67861f8524a5bebc05cd20472d3fca00da differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/18/c637c5d9aba6eed226ee1840cd1ca2e6c4e4c5 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/18/c637c5d9aba6eed226ee1840cd1ca2e6c4e4c5 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/20/3555c5676d75cd80d69b50beb1f4b588c59ceb and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/20/3555c5676d75cd80d69b50beb1f4b588c59ceb differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/23/f4582779e60bfa7f14750ad507399a58876611 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/23/f4582779e60bfa7f14750ad507399a58876611 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/2a/d3df895f68f4dda6a0a815c620b909bdd27c05 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/2a/d3df895f68f4dda6a0a815c620b909bdd27c05 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/2b/d9d81b51a867352bab307b89cbb5b4a69adfe1 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/2b/d9d81b51a867352bab307b89cbb5b4a69adfe1 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/2c/03f9f407b576eae80327864bab572e282a33ea and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/2c/03f9f407b576eae80327864bab572e282a33ea differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/33/cdead44e1c3ec178e39a4a69085280dbacf01b and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/33/cdead44e1c3ec178e39a4a69085280dbacf01b differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/3f/96bdca0e37616026afaa325c148cec4aa62d04 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/3f/96bdca0e37616026afaa325c148cec4aa62d04 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/41/7786fc35b3c71aa546e3f95eb5da3c8dad8c41 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/41/7786fc35b3c71aa546e3f95eb5da3c8dad8c41 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/47/fbc2c28a18df0dc773276a253eb85c7516ca50 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/47/fbc2c28a18df0dc773276a253eb85c7516ca50 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/5a/fb6a14a864e30787857dd92af837e8cdd2cb1b and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/5a/fb6a14a864e30787857dd92af837e8cdd2cb1b differ diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/objects/68/03c385642cebc8103fddd526ef395d75678a7e libgit2-0.23.1/tests/resources/crlf/.gitted/objects/68/03c385642cebc8103fddd526ef395d75678a7e --- libgit2-0.22.2/tests/resources/crlf/.gitted/objects/68/03c385642cebc8103fddd526ef395d75678a7e 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/objects/68/03c385642cebc8103fddd526ef395d75678a7e 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +xKj0Ьu}, !d &hZ0QvgWuz9OAHv Bh9!EM}cf52v%m` /=ZË MoeV3 +fr1pѓj8.[_ K^@kѡYj \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e libgit2-0.23.1/tests/resources/crlf/.gitted/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e --- libgit2-0.22.2/tests/resources/crlf/.gitted/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/objects/69/597764abeaa1a403ebf589d2ea579c6a8f877e 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xэ0 a3Owr&%`NĎ-J!1|si`ݸkUȢr.*{zgr>ɱcbn\ui c.x"D,N,VuՒ.umgzL=@[kIǦismbY>!nJL \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/6a/e3e9c11a51f0aabebcffcbd5c00f4beed143c9 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/6a/e3e9c11a51f0aabebcffcbd5c00f4beed143c9 differ diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc libgit2-0.23.1/tests/resources/crlf/.gitted/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc --- libgit2-0.22.2/tests/resources/crlf/.gitted/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/objects/6c/589757f65a970a6cc07c71c3f3d2528c611cbc 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +x-KN0Y;PYpr5j#ǀ=nnF3iUUp$dKbN)OL)`Pf'VpCVY$SճcqVI:W +oZ^tvӁGW9gL2<kM+Ko |\ʺ;Nݱ>$81ÛeUe r}.Q \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/77/afe26d93c49279ca90604c125496920753fede and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/77/afe26d93c49279ca90604c125496920753fede differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/85/340755cfe5e28c2835781978bb1cece91b3d0f and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/85/340755cfe5e28c2835781978bb1cece91b3d0f differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/92/0e90a663bea5d740989d5f935f6dfb473a0c5d and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/92/0e90a663bea5d740989d5f935f6dfb473a0c5d differ diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/objects/96/87e444bcbb85645cb496080434c292f1b57182 libgit2-0.23.1/tests/resources/crlf/.gitted/objects/96/87e444bcbb85645cb496080434c292f1b57182 --- libgit2-0.22.2/tests/resources/crlf/.gitted/objects/96/87e444bcbb85645cb496080434c292f1b57182 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/objects/96/87e444bcbb85645cb496080434c292f1b57182 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xAJ1@Q9E!T:Y ޢRMAoGp/m7L*LQ)yEU(JqfP2Q1%L$QS ,xѾoz|xz󰾱I 0{S@x轻}_wU+H50'2=T \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/97/449da2d225557c558ac244384d487e66c3e591 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/97/449da2d225557c558ac244384d487e66c3e591 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/9a/6c3533fef19abd6eec8e61206b5c51982b80d9 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/9a/6c3533fef19abd6eec8e61206b5c51982b80d9 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/9d/29b5bb165bf65637ffcb5ededb82ddd7c3fd13 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/9d/29b5bb165bf65637ffcb5ededb82ddd7c3fd13 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/a2/34455d62297f1856c4603686150c59fcb0aafe and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/a2/34455d62297f1856c4603686150c59fcb0aafe differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/aa/f083a9cb53dac3669dcfa0e48921580d629ec7 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/aa/f083a9cb53dac3669dcfa0e48921580d629ec7 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/af/6fcf6da196f615d7cda269b55b5c4ecfb4a5b3 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/af/6fcf6da196f615d7cda269b55b5c4ecfb4a5b3 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/bb/29a7b46b5d4ba3ea17b238ae561b81d59dc818 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/bb/29a7b46b5d4ba3ea17b238ae561b81d59dc818 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/c3/e11722855ff260bd27418988ac1467c4e9e73a and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/c3/e11722855ff260bd27418988ac1467c4e9e73a differ diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe libgit2-0.23.1/tests/resources/crlf/.gitted/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe --- libgit2-0.22.2/tests/resources/crlf/.gitted/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/objects/c8/d0b1ebcaccdd8f968c4aae3c2175e7fed651fe 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +x-Kn0C)f8od (t4#؈e9~;$RKI1*1;tf9Edb&1LʈPyk 0#*FeYtٱ{7opkuI^ec3Z? NRI)c +[^}|+?wTX #ވ,L!5C^V>=R~ \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/cd/574f5a2baa4c79504f8837b730fa0b11defe99 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/cd/574f5a2baa4c79504f8837b730fa0b11defe99 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/cd/d3dacc5c0501d5ea57bbdf90e3d80176606139 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/cd/d3dacc5c0501d5ea57bbdf90e3d80176606139 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/d1/1e7ef63ba7db1db3b1b99cdbafc57a8549f8a4 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/d1/1e7ef63ba7db1db3b1b99cdbafc57a8549f8a4 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/de/5bfa165999d9d6c6dbafad2a7e709f93ec30fd and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/de/5bfa165999d9d6c6dbafad2a7e709f93ec30fd differ diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/objects/e5/062da7d7802cf492975eda580f09ac4876bd88 libgit2-0.23.1/tests/resources/crlf/.gitted/objects/e5/062da7d7802cf492975eda580f09ac4876bd88 --- libgit2-0.22.2/tests/resources/crlf/.gitted/objects/e5/062da7d7802cf492975eda580f09ac4876bd88 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/objects/e5/062da7d7802cf492975eda580f09ac4876bd88 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xQ1D)j'd2")xN,3x^AQj)UD`iJֻ>Fc:D&Rr.1#DǓ,HPϖ}9rPGŏ6 ~ a/ }IDx$kj&_֨GZכ›| ǸU \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/f2/b745d7f47d114a3a6b31a7b628e61e804d1a58 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/f2/b745d7f47d114a3a6b31a7b628e61e804d1a58 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/f4/d25b796d86387205a5498175d66e91d1e5006a and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/f4/d25b796d86387205a5498175d66e91d1e5006a differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/crlf/.gitted/objects/fe/ab3713c4659bb22700042b3c55b8d60d0a952b and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/crlf/.gitted/objects/fe/ab3713c4659bb22700042b3c55b8d60d0a952b differ diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/refs/heads/empty-files libgit2-0.23.1/tests/resources/crlf/.gitted/refs/heads/empty-files --- libgit2-0.22.2/tests/resources/crlf/.gitted/refs/heads/empty-files 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/refs/heads/empty-files 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +9687e444bcbb85645cb496080434c292f1b57182 diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/refs/heads/master libgit2-0.23.1/tests/resources/crlf/.gitted/refs/heads/master --- libgit2-0.22.2/tests/resources/crlf/.gitted/refs/heads/master 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/refs/heads/master 2015-08-03 18:07:35.000000000 +0000 @@ -1 +1 @@ -044bcd5c9bf5ebdd51e514a9a36457018f06f6e1 +5afb6a14a864e30787857dd92af837e8cdd2cb1b diff -Nru libgit2-0.22.2/tests/resources/crlf/.gitted/refs/heads/utf8 libgit2-0.23.1/tests/resources/crlf/.gitted/refs/heads/utf8 --- libgit2-0.22.2/tests/resources/crlf/.gitted/refs/heads/utf8 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf/.gitted/refs/heads/utf8 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -2b55b4b94f655c857635b6a9005c056aa7de3532 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/.gitattributes libgit2-0.23.1/tests/resources/crlf_data/.gitattributes --- libgit2-0.22.2/tests/resources/crlf_data/.gitattributes 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/.gitattributes 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +* binary diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,-text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_false,text,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,-text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_input,text,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,-text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/posix/autocrlf_true,text,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,-text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text_auto,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_false,text,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,-text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text_auto,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_input,text,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,-text/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text_auto,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_crlf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +crlf +crlf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/all-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +lf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-all-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +one +two +three +four diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/binary-mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/few-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,22 @@ +⚽The rest is ASCII01. +The rest is ASCII02. +The rest is ASCII03. +The rest is ASCII04. +The rest is ASCII05. +The rest is ASCII06. +The rest is ASCII07. +The rest is ASCII08. +The rest is ASCII09. +The rest is ASCII10. +The rest is ASCII11. +The rest is ASCII12. +The rest is ASCII13. +The rest is ASCII14. +The rest is ASCII15. +The rest is ASCII16. +The rest is ASCII17. +The rest is ASCII18. +The rest is ASCII19. +The rest is ASCII20. +The rest is ASCII21. +The rest is ASCII22. diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/many-utf8-chars-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,4 @@ +Lets sing! +♫♪♬♩ +Eat food +🍅🍕 diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/mixed-lf-cr-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,3 @@ +one +two three +four \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-crlf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +crlf +crlf +lf +crlf +crlf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf-utf8bom libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf-utf8bom --- libgit2-0.22.2/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf-utf8bom 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/crlf_data/windows/autocrlf_true,text,eol_lf/more-lf-utf8bom 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +lf +lf +crlf +lf +lf diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/config libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/config --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/config 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/config 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/HEAD libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/HEAD --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/HEAD 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/HEAD 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +ref: refs/heads/master Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/index and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/index differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/01/bd650462136a4f0a266dfc91ab93b3fef0f7cb and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/01/bd650462136a4f0a266dfc91ab93b3fef0f7cb differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/08/3f868fb4324e32a4999173b2437b31d7a1ef25 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/08/3f868fb4324e32a4999173b2437b31d7a1ef25 differ diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/0a/a2acaa63cacc7a99fab0c2ce3d56572911df19 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/0a/a2acaa63cacc7a99fab0c2ce3d56572911df19 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/0a/a2acaa63cacc7a99fab0c2ce3d56572911df19 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/0a/a2acaa63cacc7a99fab0c2ce3d56572911df19 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xA @Qלb&fR!1Ɲ[Lqb#L&z~K:F*3g
)qJZ&B{;xk-2_ 78s-˻mSIhr Zq{C%Ӥ>4? \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/11/89e10a62aadf2fea8cd018afb52c1980f40b4f and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/11/89e10a62aadf2fea8cd018afb52c1980f40b4f differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/24/2c8f6cf388e96e2c12b6e49cb7ae60167cba1e and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/24/2c8f6cf388e96e2c12b6e49cb7ae60167cba1e differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/25/246acb001858ffeffb03ea399fd2c0a163b832 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/25/246acb001858ffeffb03ea399fd2c0a163b832 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/26/2f67de0de2e535a59ae1bc3c739601e98c354d and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/26/2f67de0de2e535a59ae1bc3c739601e98c354d differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/2f/6727d2e570bf962d9dd926423cf6fe5072071a and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/2f/6727d2e570bf962d9dd926423cf6fe5072071a differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/3c/43e7fc2a56fc825c31dfee65abd6dda8d16dca and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/3c/43e7fc2a56fc825c31dfee65abd6dda8d16dca differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/40/26a6c83f39c56881c9ac62e7582db9e3d33a4f and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/40/26a6c83f39c56881c9ac62e7582db9e3d33a4f differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/42/dabb8d5dba2de103815a77e4369bb3966e64ef and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/42/dabb8d5dba2de103815a77e4369bb3966e64ef differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/43/9230587f2eb38e9540a5c99e9831f65641eab9 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/43/9230587f2eb38e9540a5c99e9831f65641eab9 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/43/ad73e75e15f03bb0b4398a48a57ecfc20788e2 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/43/ad73e75e15f03bb0b4398a48a57ecfc20788e2 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/54/74989173042512ab630191ad71cdcedb646b9a and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/54/74989173042512ab630191ad71cdcedb646b9a differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/5e/fb9bc29c482e023e40e0a2b3b7e49cec842034 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/5e/fb9bc29c482e023e40e0a2b3b7e49cec842034 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/70/d3d2e7d51a18fcc6f035a67e5c3f33069be04d and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/70/d3d2e7d51a18fcc6f035a67e5c3f33069be04d differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/74/e83b6c5df14f1fba7c4ea1f99c6d007b591002 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/74/e83b6c5df14f1fba7c4ea1f99c6d007b591002 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/77/f40c621ceae77ad8d756ef507bdbafe2713aa7 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/77/f40c621ceae77ad8d756ef507bdbafe2713aa7 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/9c/5362069759fb37ae036cef6e4b2f95c6c5eaab and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/9c/5362069759fb37ae036cef6e4b2f95c6c5eaab differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/a2/9e7dabd68dfb38a717e6b1648713cd5c7adee2 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/a2/9e7dabd68dfb38a717e6b1648713cd5c7adee2 differ diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/a4/e6a86e07ef5afe036e26602fbbaa27496d00a9 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/a4/e6a86e07ef5afe036e26602fbbaa27496d00a9 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/a4/e6a86e07ef5afe036e26602fbbaa27496d00a9 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/a4/e6a86e07ef5afe036e26602fbbaa27496d00a9 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +xMJ@])j7 A:]"3 U5ՓIYx{#'pZEk(DA EPk!Xs }\|yk>oMA ϱL_t3`ZdAe \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/a8/27eab4fd66ab37a6ebcfaa7b7e341abfd55947 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/a8/27eab4fd66ab37a6ebcfaa7b7e341abfd55947 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/a9/66acc271e50b5d4595911752a77def0a5e5d40 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/a9/66acc271e50b5d4595911752a77def0a5e5d40 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/b2/a69114f4897109fedf1aafea363cb2d2557029 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/b2/a69114f4897109fedf1aafea363cb2d2557029 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/bc/83ac0422ba1082c80e406234910377984cfbb6 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/bc/83ac0422ba1082c80e406234910377984cfbb6 differ diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/bf/e4ea5805af22a5b194259bda6f5f634486f891 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/bf/e4ea5805af22a5b194259bda6f5f634486f891 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/bf/e4ea5805af22a5b194259bda6f5f634486f891 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/bf/e4ea5805af22a5b194259bda6f5f634486f891 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xMj0F)flA)%B/x4Jcho_!}T׵X?HcC)iL`??`ʎffnxЈ tf4Y!;M$,'>/_}wiT70u)FF8i:*ԈZp!1(-MozX \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/c3/b1fb31424c98072542cc8e42b48c92e52f494a and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/c3/b1fb31424c98072542cc8e42b48c92e52f494a differ diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/c7/e2f386736445936f5ba181269a0e0967e280e8 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/c7/e2f386736445936f5ba181269a0e0967e280e8 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/c7/e2f386736445936f5ba181269a0e0967e280e8 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/c7/e2f386736445936f5ba181269a0e0967e280e8 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +xAj0E)fEȒFA) +=CQF Y^MI{><>^YyЛ*5X|&Ęl"Rg>!٘*>Z֨A\XbAeT H:(C9Vч@R }\qyk;&TG57zK/yvQKpߓ`ZOl$e \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/d9/5182053c31f8aa09df4fa225f4e668c5320b59 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/d9/5182053c31f8aa09df4fa225f4e668c5320b59 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/d9/5182053c31f8aa09df4fa225f4e668c5320b59 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/d9/5182053c31f8aa09df4fa225f4e668c5320b59 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,5 @@ +xM +0@a9$M/z: +1I^#4Eh.:M'6uv&k `JY +Z 5D1$9zgXI:,nįM +\%OcwgsyJ^ƸC, ~WQaRVbh~,3\gR \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/ec/5a35c75b8d3ee29bed37996b14e909d04fdcee and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/ec/5a35c75b8d3ee29bed37996b14e909d04fdcee differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/ee/3c2aac8e03224c323b58ecb1f9eef616745467 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/ee/3c2aac8e03224c323b58ecb1f9eef616745467 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/ef/e94a4bf4e697f7f0270f0d1b8a93af784a19d0 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/ef/e94a4bf4e697f7f0270f0d1b8a93af784a19d0 differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f0/0c965d8307308469e537302baa73048488f162 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f0/0c965d8307308469e537302baa73048488f162 differ diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f1/90a0d111ca1688778657798743ddfb4ed4bd64 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f1/90a0d111ca1688778657798743ddfb4ed4bd64 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f1/90a0d111ca1688778657798743ddfb4ed4bd64 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f1/90a0d111ca1688778657798743ddfb4ed4bd64 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +xM +0@a9Eo .o1IZ![nZԥad!y![fCԎQaVn̉Y%0PJk!;@@=>xS%h{E^iyE?&tHv0g+t[WD\ܷqM \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f4/9b2c244e9d3b0647fdfb95954c38fbfeecf3ad libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f4/9b2c244e9d3b0647fdfb95954c38fbfeecf3ad --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f4/9b2c244e9d3b0647fdfb95954c38fbfeecf3ad 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f4/9b2c244e9d3b0647fdfb95954c38fbfeecf3ad 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,2 @@ +x= +1@abzAfI-!,.xۯx/mСWU(dRt}@j9.2;O"KTelV{h֒:> .=oz8\ab^ĞHf}R< \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f8/7905f99f0e66d179a8379d8ca4d8cbbd32c231 libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f8/7905f99f0e66d179a8379d8ca4d8cbbd32c231 --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/objects/f8/7905f99f0e66d179a8379d8ca4d8cbbd32c231 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/objects/f8/7905f99f0e66d179a8379d8ca4d8cbbd32c231 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xKj0D)E tg50@ g0-e;`;#ˋ> WEQe2ZQaoj7{L9IH}sLgrvŊ!9!:G͞mz* 2aM:kzѦNCv.uם׽ՙmySx=3h&*>b5Mr!iu׶=܁i \ No newline at end of file diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_change libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_change --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_change 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_change 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +d95182053c31f8aa09df4fa225f4e668c5320b59 diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_eol libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_eol --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_eol 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_a_eol 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +9c5362069759fb37ae036cef6e4b2f95c6c5eaab diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_change libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_change --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_change 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_change 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +b2a69114f4897109fedf1aafea363cb2d2557029 diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_eol libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_eol --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_eol 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/branch_b_eol 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +bfe4ea5805af22a5b194259bda6f5f634486f891 diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/master libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/master --- libgit2-0.22.2/tests/resources/merge-whitespace/.gitted/refs/heads/master 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/.gitted/refs/heads/master 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +1189e10a62aadf2fea8cd018afb52c1980f40b4f diff -Nru libgit2-0.22.2/tests/resources/merge-whitespace/test.txt libgit2-0.23.1/tests/resources/merge-whitespace/test.txt --- libgit2-0.22.2/tests/resources/merge-whitespace/test.txt 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/merge-whitespace/test.txt 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,11 @@ +0 +1 +2 +3 +4 +5 XXX +6 +7 +8 +9 +10 diff -Nru libgit2-0.22.2/tests/resources/testrepo/.gitted/objects/6f/d5c7dd2ab27b48c493023f794be09861e9045f libgit2-0.23.1/tests/resources/testrepo/.gitted/objects/6f/d5c7dd2ab27b48c493023f794be09861e9045f --- libgit2-0.22.2/tests/resources/testrepo/.gitted/objects/6f/d5c7dd2ab27b48c493023f794be09861e9045f 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/testrepo/.gitted/objects/6f/d5c7dd2ab27b48c493023f794be09861e9045f 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +xA!D}G Mr\m[F11gȢ(GRr3Co"v^hq<7AY{"&$DSg([B!ΡwƳYgl$%Eֲ'\d_w-[k'1hZt B&;:A"m%V \ No newline at end of file Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/testrepo/.gitted/objects/c3/6d8ea75da8cb510fcb0c408c1d7e53f9a99dbe and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/testrepo/.gitted/objects/c3/6d8ea75da8cb510fcb0c408c1d7e53f9a99dbe differ Binary files /tmp/tmpSacDN_/OfTL3MRafY/libgit2-0.22.2/tests/resources/testrepo/.gitted/objects/e3/6900c3224db4adf4c7f7a09d4ac80247978a13 and /tmp/tmpSacDN_/WiB66ppIHu/libgit2-0.23.1/tests/resources/testrepo/.gitted/objects/e3/6900c3224db4adf4c7f7a09d4ac80247978a13 differ diff -Nru libgit2-0.22.2/tests/resources/testrepo/.gitted/refs/heads/ident libgit2-0.23.1/tests/resources/testrepo/.gitted/refs/heads/ident --- libgit2-0.22.2/tests/resources/testrepo/.gitted/refs/heads/ident 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/resources/testrepo/.gitted/refs/heads/ident 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1 @@ +6fd5c7dd2ab27b48c493023f794be09861e9045f diff -Nru libgit2-0.22.2/tests/resources/testrepo2/.gitted/config libgit2-0.23.1/tests/resources/testrepo2/.gitted/config --- libgit2-0.22.2/tests/resources/testrepo2/.gitted/config 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/resources/testrepo2/.gitted/config 2015-08-03 18:07:35.000000000 +0000 @@ -8,7 +8,19 @@ [remote "origin"] url = https://github.com/libgit2/false.git fetch = +refs/heads/*:refs/remotes/origin/* +[remote "insteadof-test"] + url = http://example.com/libgit2/libgit2 + pushurl = http://github.com/libgit2/libgit2 + fetch = +refs/heads/*:refs/remotes/test/* [branch "master"] remote = origin merge = refs/heads/master rebase = true +[url "longer-non-prefix-match"] + insteadOf = ttp://example.com/li +[url "shorter-prefix"] + insteadOf = http://example.co +[url "http://github.com"] + insteadOf = http://example.com +[url "git@github.com:"] + pushInsteadOf = http://github.com/ diff -Nru libgit2-0.22.2/tests/revert/workdir.c libgit2-0.23.1/tests/revert/workdir.c --- libgit2-0.22.2/tests/revert/workdir.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/revert/workdir.c 2015-08-03 18:07:35.000000000 +0000 @@ -48,7 +48,7 @@ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac"); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -81,7 +81,7 @@ cl_git_pass(git_repository_head(&head_ref, repo)); cl_git_pass(git_reference_peel((git_object **)&head, head_ref, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); cl_git_pass(git_revert(repo, commit, NULL)); @@ -144,7 +144,7 @@ git_oid_fromstr(&head_oid, "39467716290f6df775a91cdb9a4eb39295018145"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&revert_oid, "ebb03002cee5d66c7732dd06241119fe72ab96a5"); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -179,7 +179,7 @@ cl_git_pass(git_repository_head(&head_ref, repo)); cl_git_pass(git_reference_peel((git_object **)&orig_head, head_ref, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, (git_object *)orig_head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)orig_head, GIT_RESET_HARD, NULL)); cl_git_pass(git_revert(repo, orig_head, NULL)); @@ -227,7 +227,7 @@ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac"); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -275,7 +275,7 @@ cl_git_pass(git_oid_fromstr(&orig_head_oid, "399fb3aba3d9d13f7d40a9254ce4402067ef3149")); cl_git_pass(git_commit_lookup(&orig_head, repo, &orig_head_oid)); - cl_git_pass(git_reset(repo, (git_object *)orig_head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)orig_head, GIT_RESET_HARD, NULL)); cl_git_pass(git_oid_fromstr(&revert_oid, "2d440f2b3147d3dc7ad1085813478d6d869d5a4d")); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -324,7 +324,7 @@ cl_git_pass(git_oid_fromstr(&head_commit_oid, "75ec9929465623f17ff3ad68c0438ea56faba815")); cl_git_pass(git_commit_lookup(&head_commit, repo, &head_commit_oid)); - cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD, NULL)); cl_git_pass(git_oid_fromstr(&revert_commit_oid, "97e52d5e81f541080cd6b92829fb85bc4d81d90b")); cl_git_pass(git_commit_lookup(&revert_commit, repo, &revert_commit_oid)); @@ -334,16 +334,18 @@ cl_assert(merge_test_index(repo_index, merge_index_entries, 3)); cl_git_pass(git_futils_readbuffer(&diff_buf, "revert/file.txt")); - cl_assert(strcmp(diff_buf.ptr, "a\n" \ - "<<<<<<< HEAD\n" \ - "=======\n" \ - "a\n" \ - ">>>>>>> parent of 97e52d5... Revert me\n" \ - "a\n" \ - "a\n" \ - "a\n" \ - "a\n" \ - "ab\n") == 0); + cl_assert_equal_s( + "a\n" \ + "<<<<<<< HEAD\n" \ + "=======\n" \ + "a\n" \ + ">>>>>>> parent of 97e52d5... Revert me\n" \ + "a\n" \ + "a\n" \ + "a\n" \ + "a\n" \ + "ab", + diff_buf.ptr); git_commit_free(revert_commit); git_commit_free(head_commit); @@ -377,7 +379,7 @@ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac"); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -408,12 +410,12 @@ { 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 2, "file6.txt" }, }; - opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&revert_oid, "55568c8de5322ff9a95d72747a239cdb64a19965"); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -442,12 +444,12 @@ { "file4.txt", "file5.txt", "" }, }; - opts.merge_opts.flags |= GIT_MERGE_TREE_FIND_RENAMES; + opts.merge_opts.tree_flags |= GIT_MERGE_TREE_FIND_RENAMES; opts.merge_opts.rename_threshold = 50; git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); git_oid_fromstr(&revert_oid, "0aa8c7e40d342fff78d60b29a4ba8e993ed79c51"); cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid)); @@ -476,7 +478,7 @@ /* HEAD is 2d440f2b3147d3dc7ad1085813478d6d869d5a4d */ cl_git_pass(git_repository_head(&head, repo)); cl_git_pass(git_reference_peel((git_object **)&commit, head, GIT_OBJ_COMMIT)); - cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL)); cl_git_pass(git_revert(repo, commit, NULL)); cl_assert(merge_test_index(repo_index, merge_index_entries, 4)); @@ -513,7 +515,7 @@ git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); cl_must_fail(git_revert(repo, head, NULL)); cl_assert(!git_path_exists(TEST_REPO_PATH "/.git/MERGE_MSG")); @@ -540,7 +542,7 @@ git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); cl_git_pass(git_revert(repo, head, &opts)); @@ -565,7 +567,7 @@ git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579"); cl_git_pass(git_commit_lookup(&head, repo, &head_oid)); - cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL)); + cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL)); cl_git_pass(git_revert(repo, head, &opts)); diff -Nru libgit2-0.22.2/tests/revwalk/basic.c libgit2-0.23.1/tests/revwalk/basic.c --- libgit2-0.22.2/tests/revwalk/basic.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/revwalk/basic.c 2015-08-03 18:07:35.000000000 +0000 @@ -177,7 +177,7 @@ /* walking */; /* git log --branches --oneline | wc -l => 16 */ - cl_assert_equal_i(17, i); + cl_assert_equal_i(18, i); } void test_revwalk_basic__push_head(void) @@ -314,6 +314,23 @@ cl_git_fail(git_revwalk_push(_walk, &oid)); } +void test_revwalk_basic__hide_then_push(void) +{ + git_oid oid; + int i = 0; + + revwalk_basic_setup_walk(NULL); + cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644")); + + cl_git_pass(git_revwalk_hide(_walk, &oid)); + cl_git_pass(git_revwalk_push(_walk, &oid)); + + while (git_revwalk_next(&oid, _walk) == 0) + i++; + + cl_assert_equal_i(i, 0); +} + void test_revwalk_basic__push_range(void) { revwalk_basic_setup_walk(NULL); diff -Nru libgit2-0.22.2/tests/stash/apply.c libgit2-0.23.1/tests/stash/apply.c --- libgit2-0.22.2/tests/stash/apply.c 1970-01-01 00:00:00.000000000 +0000 +++ libgit2-0.23.1/tests/stash/apply.c 2015-08-03 18:07:35.000000000 +0000 @@ -0,0 +1,449 @@ +#include "clar_libgit2.h" +#include "fileops.h" +#include "stash_helpers.h" + +static git_signature *signature; +static git_repository *repo; +static git_index *repo_index; + +void test_stash_apply__initialize(void) +{ + git_oid oid; + + repo = cl_git_sandbox_init_new("stash"); + cl_git_pass(git_repository_index(&repo_index, repo)); + cl_git_pass(git_signature_new(&signature, "nulltoken", "emeric.fermas@gmail.com", 1323847743, 60)); /* Wed Dec 14 08:29:03 2011 +0100 */ + + cl_git_mkfile("stash/what", "hello\n"); + cl_git_mkfile("stash/how", "small\n"); + cl_git_mkfile("stash/who", "world\n"); + cl_git_mkfile("stash/where", "meh\n"); + + cl_git_pass(git_index_add_bypath(repo_index, "what")); + cl_git_pass(git_index_add_bypath(repo_index, "how")); + cl_git_pass(git_index_add_bypath(repo_index, "who")); + + cl_repo_commit_from_index(NULL, repo, signature, 0, "Initial commit"); + + cl_git_rewritefile("stash/what", "goodbye\n"); + cl_git_rewritefile("stash/who", "funky world\n"); + cl_git_mkfile("stash/when", "tomorrow\n"); + cl_git_mkfile("stash/why", "would anybody use stash?\n"); + cl_git_mkfile("stash/where", "????\n"); + + cl_git_pass(git_index_add_bypath(repo_index, "who")); + cl_git_pass(git_index_add_bypath(repo_index, "why")); + cl_git_pass(git_index_add_bypath(repo_index, "where")); + git_index_write(repo_index); + + cl_git_rewritefile("stash/where", "....\n"); + + /* Pre-stash state */ + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); + assert_status(repo, "where", GIT_STATUS_INDEX_NEW|GIT_STATUS_WT_MODIFIED); + + cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED)); + + /* Post-stash state */ + assert_status(repo, "what", GIT_STATUS_CURRENT); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_CURRENT); + assert_status(repo, "when", GIT_ENOTFOUND); + assert_status(repo, "why", GIT_ENOTFOUND); + assert_status(repo, "where", GIT_ENOTFOUND); +} + +void test_stash_apply__cleanup(void) +{ + git_signature_free(signature); + signature = NULL; + + git_index_free(repo_index); + repo_index = NULL; + + cl_git_sandbox_cleanup(); +} + +void test_stash_apply__with_default(void) +{ + git_buf where = GIT_BUF_INIT; + + cl_git_pass(git_stash_apply(repo, 0, NULL)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); + assert_status(repo, "where", GIT_STATUS_INDEX_NEW); + + cl_git_pass(git_futils_readbuffer(&where, "stash/where")); + cl_assert_equal_s("....\n", where.ptr); + + git_buf_free(&where); +} + +void test_stash_apply__with_existing_file(void) +{ + cl_git_mkfile("stash/where", "oops!\n"); + cl_git_fail(git_stash_apply(repo, 0, NULL)); +} + +void test_stash_apply__merges_new_file(void) +{ + const git_index_entry *ancestor, *our, *their; + + cl_git_mkfile("stash/where", "committed before stash\n"); + cl_git_pass(git_index_add_bypath(repo_index, "where")); + cl_repo_commit_from_index(NULL, repo, signature, 0, "Other commit"); + + cl_git_pass(git_stash_apply(repo, 0, NULL)); + + cl_assert_equal_i(1, git_index_has_conflicts(repo_index)); + assert_status(repo, "what", GIT_STATUS_INDEX_MODIFIED); + cl_git_pass(git_index_conflict_get(&ancestor, &our, &their, repo_index, "where")); /* unmerged */ + assert_status(repo, "who", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); +} + +void test_stash_apply__with_reinstate_index(void) +{ + git_buf where = GIT_BUF_INIT; + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + + opts.flags = GIT_STASH_APPLY_REINSTATE_INDEX; + + cl_git_pass(git_stash_apply(repo, 0, &opts)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); + assert_status(repo, "where", GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_MODIFIED); + + cl_git_pass(git_futils_readbuffer(&where, "stash/where")); + cl_assert_equal_s("....\n", where.ptr); + + git_buf_free(&where); +} + +void test_stash_apply__conflict_index_with_default(void) +{ + const git_index_entry *ancestor; + const git_index_entry *our; + const git_index_entry *their; + + cl_git_rewritefile("stash/who", "nothing\n"); + cl_git_pass(git_index_add_bypath(repo_index, "who")); + cl_git_pass(git_index_write(repo_index)); + cl_repo_commit_from_index(NULL, repo, signature, 0, "Other commit"); + + cl_git_pass(git_stash_apply(repo, 0, NULL)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 1); + assert_status(repo, "what", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + cl_git_pass(git_index_conflict_get(&ancestor, &our, &their, repo_index, "who")); /* unmerged */ + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); +} + +void test_stash_apply__conflict_index_with_reinstate_index(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + + opts.flags = GIT_STASH_APPLY_REINSTATE_INDEX; + + cl_git_rewritefile("stash/who", "nothing\n"); + cl_git_pass(git_index_add_bypath(repo_index, "who")); + cl_git_pass(git_index_write(repo_index)); + cl_repo_commit_from_index(NULL, repo, signature, 0, "Other commit"); + + cl_git_fail_with(git_stash_apply(repo, 0, &opts), GIT_ECONFLICT); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_CURRENT); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_CURRENT); + assert_status(repo, "when", GIT_ENOTFOUND); + assert_status(repo, "why", GIT_ENOTFOUND); +} + +void test_stash_apply__conflict_untracked_with_default(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + + cl_git_mkfile("stash/when", "nothing\n"); + + cl_git_fail_with(git_stash_apply(repo, 0, &opts), GIT_ECONFLICT); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_CURRENT); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_CURRENT); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_ENOTFOUND); +} + +void test_stash_apply__conflict_untracked_with_reinstate_index(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + + opts.flags = GIT_STASH_APPLY_REINSTATE_INDEX; + + cl_git_mkfile("stash/when", "nothing\n"); + + cl_git_fail_with(git_stash_apply(repo, 0, &opts), GIT_ECONFLICT); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_CURRENT); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_CURRENT); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_ENOTFOUND); +} + +void test_stash_apply__conflict_workdir_with_default(void) +{ + cl_git_rewritefile("stash/what", "ciao\n"); + + cl_git_fail_with(git_stash_apply(repo, 0, NULL), GIT_ECONFLICT); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_CURRENT); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_ENOTFOUND); +} + +void test_stash_apply__conflict_workdir_with_reinstate_index(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + + opts.flags = GIT_STASH_APPLY_REINSTATE_INDEX; + + cl_git_rewritefile("stash/what", "ciao\n"); + + cl_git_fail_with(git_stash_apply(repo, 0, &opts), GIT_ECONFLICT); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_CURRENT); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_ENOTFOUND); +} + +void test_stash_apply__conflict_commit_with_default(void) +{ + const git_index_entry *ancestor; + const git_index_entry *our; + const git_index_entry *their; + + cl_git_rewritefile("stash/what", "ciao\n"); + cl_git_pass(git_index_add_bypath(repo_index, "what")); + cl_repo_commit_from_index(NULL, repo, signature, 0, "Other commit"); + + cl_git_pass(git_stash_apply(repo, 0, NULL)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 1); + cl_git_pass(git_index_conflict_get(&ancestor, &our, &their, repo_index, "what")); /* unmerged */ + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); +} + +void test_stash_apply__conflict_commit_with_reinstate_index(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + const git_index_entry *ancestor; + const git_index_entry *our; + const git_index_entry *their; + + opts.flags = GIT_STASH_APPLY_REINSTATE_INDEX; + + cl_git_rewritefile("stash/what", "ciao\n"); + cl_git_pass(git_index_add_bypath(repo_index, "what")); + cl_repo_commit_from_index(NULL, repo, signature, 0, "Other commit"); + + cl_git_pass(git_stash_apply(repo, 0, &opts)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 1); + cl_git_pass(git_index_conflict_get(&ancestor, &our, &their, repo_index, "what")); /* unmerged */ + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); +} + +void test_stash_apply__fails_with_uncommitted_changes_in_index(void) +{ + cl_git_rewritefile("stash/who", "nothing\n"); + cl_git_pass(git_index_add_bypath(repo_index, "who")); + cl_git_pass(git_index_write(repo_index)); + + cl_git_fail_with(git_stash_apply(repo, 0, NULL), GIT_EUNCOMMITTED); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_CURRENT); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_INDEX_MODIFIED); + assert_status(repo, "when", GIT_ENOTFOUND); + assert_status(repo, "why", GIT_ENOTFOUND); +} + +void test_stash_apply__pop(void) +{ + cl_git_pass(git_stash_pop(repo, 0, NULL)); + + cl_git_fail_with(git_stash_pop(repo, 0, NULL), GIT_ENOTFOUND); +} + +struct seen_paths { + bool what; + bool how; + bool who; + bool when; +}; + +int checkout_notify( + git_checkout_notify_t why, + const char *path, + const git_diff_file *baseline, + const git_diff_file *target, + const git_diff_file *workdir, + void *payload) +{ + struct seen_paths *seen_paths = (struct seen_paths *)payload; + + GIT_UNUSED(why); + GIT_UNUSED(baseline); + GIT_UNUSED(target); + GIT_UNUSED(workdir); + + if (strcmp(path, "what") == 0) + seen_paths->what = 1; + else if (strcmp(path, "how") == 0) + seen_paths->how = 1; + else if (strcmp(path, "who") == 0) + seen_paths->who = 1; + else if (strcmp(path, "when") == 0) + seen_paths->when = 1; + + return 0; +} + +void test_stash_apply__executes_notify_cb(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + struct seen_paths seen_paths = {0}; + + opts.checkout_options.notify_cb = checkout_notify; + opts.checkout_options.notify_flags = GIT_CHECKOUT_NOTIFY_ALL; + opts.checkout_options.notify_payload = &seen_paths; + + cl_git_pass(git_stash_apply(repo, 0, &opts)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); + assert_status(repo, "where", GIT_STATUS_INDEX_NEW); + + cl_assert_equal_b(true, seen_paths.what); + cl_assert_equal_b(false, seen_paths.how); + cl_assert_equal_b(true, seen_paths.who); + cl_assert_equal_b(true, seen_paths.when); +} + +int progress_cb( + git_stash_apply_progress_t progress, + void *payload) +{ + git_stash_apply_progress_t *p = (git_stash_apply_progress_t *)payload; + + cl_assert_equal_i((*p)+1, progress); + + *p = progress; + + return 0; +} + +void test_stash_apply__calls_progress_cb(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + git_stash_apply_progress_t progress = GIT_STASH_APPLY_PROGRESS_NONE; + + opts.progress_cb = progress_cb; + opts.progress_payload = &progress; + + cl_git_pass(git_stash_apply(repo, 0, &opts)); + cl_assert_equal_i(progress, GIT_STASH_APPLY_PROGRESS_DONE); +} + +int aborting_progress_cb( + git_stash_apply_progress_t progress, + void *payload) +{ + GIT_UNUSED(payload); + + if (progress == GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED) + return -44; + + return 0; +} + +void test_stash_apply__progress_cb_can_abort(void) +{ + git_stash_apply_options opts = GIT_STASH_APPLY_OPTIONS_INIT; + + opts.progress_cb = aborting_progress_cb; + + cl_git_fail_with(-44, git_stash_apply(repo, 0, &opts)); +} + +void test_stash_apply__uses_reflog_like_indices_1(void) +{ + git_oid oid; + + cl_git_mkfile("stash/untracked", "untracked\n"); + cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED)); + assert_status(repo, "untracked", GIT_ENOTFOUND); + + // stash@{1} is the oldest (first) stash we made + cl_git_pass(git_stash_apply(repo, 1, NULL)); + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "what", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "how", GIT_STATUS_CURRENT); + assert_status(repo, "who", GIT_STATUS_WT_MODIFIED); + assert_status(repo, "when", GIT_STATUS_WT_NEW); + assert_status(repo, "why", GIT_STATUS_INDEX_NEW); + assert_status(repo, "where", GIT_STATUS_INDEX_NEW); +} + +void test_stash_apply__uses_reflog_like_indices_2(void) +{ + git_oid oid; + + cl_git_mkfile("stash/untracked", "untracked\n"); + cl_git_pass(git_stash_save(&oid, repo, signature, NULL, GIT_STASH_INCLUDE_UNTRACKED)); + assert_status(repo, "untracked", GIT_ENOTFOUND); + + // stash@{0} is the newest stash we made immediately above + cl_git_pass(git_stash_apply(repo, 0, NULL)); + + cl_assert_equal_i(git_index_has_conflicts(repo_index), 0); + assert_status(repo, "untracked", GIT_STATUS_WT_NEW); +} diff -Nru libgit2-0.22.2/tests/stash/foreach.c libgit2-0.23.1/tests/stash/foreach.c --- libgit2-0.22.2/tests/stash/foreach.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/stash/foreach.c 2015-08-03 18:07:35.000000000 +0000 @@ -69,16 +69,16 @@ void test_stash_foreach__can_enumerate_a_repository(void) { char *oids_default[] = { - "1d91c842a7cdfc25872b3a763e5c31add8816c25", NULL }; + "493568b7a2681187aaac8a58d3f1eab1527cba84", NULL }; char *oids_untracked[] = { "7f89a8b15c878809c5c54d1ff8f8c9674154017b", - "1d91c842a7cdfc25872b3a763e5c31add8816c25", NULL }; + "493568b7a2681187aaac8a58d3f1eab1527cba84", NULL }; char *oids_ignored[] = { "c95599a8fef20a7e57582c6727b1a0d02e0a5828", "7f89a8b15c878809c5c54d1ff8f8c9674154017b", - "1d91c842a7cdfc25872b3a763e5c31add8816c25", NULL }; + "493568b7a2681187aaac8a58d3f1eab1527cba84", NULL }; cl_git_pass(git_repository_init(&repo, REPO_NAME, 0)); @@ -96,9 +96,7 @@ cl_git_pass(git_stash_foreach(repo, callback_cb, &data)); cl_assert_equal_i(1, data.invokes); - data.oids = oids_untracked; - data.invokes = 0; - + /* ensure stash_foreach operates with INCLUDE_UNTRACKED */ cl_git_pass(git_stash_save( &stash_tip_oid, repo, @@ -106,12 +104,13 @@ NULL, GIT_STASH_INCLUDE_UNTRACKED)); + data.oids = oids_untracked; + data.invokes = 0; + cl_git_pass(git_stash_foreach(repo, callback_cb, &data)); cl_assert_equal_i(2, data.invokes); - data.oids = oids_ignored; - data.invokes = 0; - + /* ensure stash_foreach operates with INCLUDE_IGNORED */ cl_git_pass(git_stash_save( &stash_tip_oid, repo, @@ -119,6 +118,9 @@ NULL, GIT_STASH_INCLUDE_IGNORED)); + data.oids = oids_ignored; + data.invokes = 0; + cl_git_pass(git_stash_foreach(repo, callback_cb, &data)); cl_assert_equal_i(3, data.invokes); } diff -Nru libgit2-0.22.2/tests/stash/save.c libgit2-0.23.1/tests/stash/save.c --- libgit2-0.22.2/tests/stash/save.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/stash/save.c 2015-08-03 18:07:35.000000000 +0000 @@ -100,12 +100,18 @@ assert_blob_oid("refs/stash:how", "e6d64adb2c7f3eb8feb493b556cc8070dca379a3"); /* not so small and */ assert_blob_oid("refs/stash:who", "a0400d4954659306a976567af43125a0b1aa8595"); /* funky world */ assert_blob_oid("refs/stash:when", NULL); + assert_blob_oid("refs/stash:why", "88c2533e21f098b89c91a431d8075cbdbe422a51"); /* would anybody use stash? */ + assert_blob_oid("refs/stash:where", "e3d6434ec12eb76af8dfa843a64ba6ab91014a0b"); /* .... */ + assert_blob_oid("refs/stash:.gitignore", "ac4d88de61733173d9959e4b77c69b9f17a00980"); assert_blob_oid("refs/stash:just.ignore", NULL); assert_blob_oid("refs/stash^2:what", "dd7e1c6f0fefe118f0b63d9f10908c460aa317a6"); /* goodbye */ assert_blob_oid("refs/stash^2:how", "e6d64adb2c7f3eb8feb493b556cc8070dca379a3"); /* not so small and */ assert_blob_oid("refs/stash^2:who", "cc628ccd10742baea8241c5924df992b5c019f71"); /* world */ assert_blob_oid("refs/stash^2:when", NULL); + assert_blob_oid("refs/stash^2:why", "88c2533e21f098b89c91a431d8075cbdbe422a51"); /* would anybody use stash? */ + assert_blob_oid("refs/stash^2:where", "e08f7fbb9a42a0c5367cf8b349f1f08c3d56bd72"); /* ???? */ + assert_blob_oid("refs/stash^2:.gitignore", "ac4d88de61733173d9959e4b77c69b9f17a00980"); assert_blob_oid("refs/stash^2:just.ignore", NULL); assert_blob_oid("refs/stash^3", NULL); @@ -195,7 +201,7 @@ { git_reference *head; - cl_git_pass(git_reference_symbolic_create(&head, repo, "HEAD", "refs/heads/unborn", 1, NULL, NULL)); + cl_git_pass(git_reference_symbolic_create(&head, repo, "HEAD", "refs/heads/unborn", 1, NULL)); cl_assert_equal_i(GIT_EUNBORNBRANCH, git_stash_save(&stash_tip_oid, repo, signature, NULL, GIT_STASH_DEFAULT)); @@ -217,7 +223,7 @@ void test_stash_save__can_stash_against_a_detached_head(void) { - git_repository_detach_head(repo, NULL, NULL); + git_repository_detach_head(repo); cl_git_pass(git_stash_save(&stash_tip_oid, repo, signature, NULL, GIT_STASH_DEFAULT)); @@ -243,11 +249,13 @@ cl_git_pass(git_repository_index(&index, repo)); /* - * 'what' and 'who' are being committed. - * 'when' remain untracked. + * 'what', 'where' and 'who' are being committed. + * 'when' remains untracked. */ cl_git_pass(git_index_add_bypath(index, "what")); + cl_git_pass(git_index_add_bypath(index, "where")); cl_git_pass(git_index_add_bypath(index, "who")); + cl_repo_commit_from_index(NULL, repo, signature, 0, "Initial commit"); git_index_free(index); @@ -399,3 +407,22 @@ assert_status(repo, "untracked_repo/", GIT_STATUS_WT_NEW); } + +void test_stash_save__deleted_in_index_modified_in_workdir(void) +{ + git_index *index; + + git_repository_index(&index, repo); + + cl_git_pass(git_index_remove_bypath(index, "who")); + cl_git_pass(git_index_write(index)); + + assert_status(repo, "who", GIT_STATUS_WT_NEW | GIT_STATUS_INDEX_DELETED); + + cl_git_pass(git_stash_save(&stash_tip_oid, repo, signature, NULL, GIT_STASH_DEFAULT)); + + assert_blob_oid("stash@{0}^0:who", "a0400d4954659306a976567af43125a0b1aa8595"); + assert_blob_oid("stash@{0}^2:who", NULL); + + git_index_free(index); +} diff -Nru libgit2-0.22.2/tests/stash/stash_helpers.c libgit2-0.23.1/tests/stash/stash_helpers.c --- libgit2-0.22.2/tests/stash/stash_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/stash/stash_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -26,12 +26,17 @@ cl_git_rewritefile("stash/what", "goodbye\n"); /* dd7e1c6f0fefe118f0b63d9f10908c460aa317a6 */ cl_git_rewritefile("stash/how", "not so small and\n"); /* e6d64adb2c7f3eb8feb493b556cc8070dca379a3 */ cl_git_rewritefile("stash/who", "funky world\n"); /* a0400d4954659306a976567af43125a0b1aa8595 */ + cl_git_mkfile("stash/why", "would anybody use stash?\n"); /* 88c2533e21f098b89c91a431d8075cbde422a51 */ + cl_git_mkfile("stash/where", "????\n"); /* e08f7fbb9a42a0c5367cf8b349f1f08c3d56bd72 */ cl_git_pass(git_index_add_bypath(index, "what")); cl_git_pass(git_index_add_bypath(index, "how")); + cl_git_pass(git_index_add_bypath(index, "why")); + cl_git_pass(git_index_add_bypath(index, "where")); cl_git_pass(git_index_write(index)); cl_git_rewritefile("stash/what", "see you later\n"); /* bc99dc98b3eba0e9157e94769cd4d49cb49de449 */ + cl_git_mkfile("stash/where", "....\n"); /* e3d6434ec12eb76af8dfa843a64ba6ab91014a0b */ git_index_free(index); } diff -Nru libgit2-0.22.2/tests/status/ignore.c libgit2-0.23.1/tests/status/ignore.c --- libgit2-0.22.2/tests/status/ignore.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/status/ignore.c 2015-08-03 18:07:35.000000000 +0000 @@ -892,6 +892,59 @@ cl_assert(found_parent_child2_file); } +void test_status_ignore__negative_directory_ignores(void) +{ + static const char *test_files[] = { + "empty_standard_repo/parent/child1/bar.txt", + "empty_standard_repo/parent/child2/bar.txt", + "empty_standard_repo/parent/child3/foo.txt", + "empty_standard_repo/parent/child4/bar.txt", + "empty_standard_repo/parent/nested/child5/bar.txt", + "empty_standard_repo/parent/nested/child6/bar.txt", + "empty_standard_repo/parent/nested/child7/bar.txt", + "empty_standard_repo/padded_parent/child8/bar.txt", + NULL + }; + + make_test_data("empty_standard_repo", test_files); + cl_git_mkfile( + "empty_standard_repo/.gitignore", + "foo.txt\n" + "parent/child1\n" + "parent/child2\n" + "parent/child4\n" + "parent/nested/child5\n" + "nested/child6\n" + "nested/child7\n" + "padded_parent/child8\n" + /* test simple exact match */ + "!parent/child1\n" + /* test negating file without negating dir */ + "!parent/child2/bar.txt\n" + /* test negative pattern on dir with its content + * being ignored */ + "!parent/child3\n" + /* test with partial match at end */ + "!child4\n" + /* test with partial match with '/' at end */ + "!nested/child5\n" + /* test with complete match */ + "!nested/child6\n" + /* test with trailing '/' */ + "!child7/\n" + /* test with partial dir match */ + "!_parent/child8\n"); + + refute_is_ignored("parent/child1/bar.txt"); + assert_is_ignored("parent/child2/bar.txt"); + assert_is_ignored("parent/child3/foo.txt"); + refute_is_ignored("parent/child4/bar.txt"); + assert_is_ignored("parent/nested/child5/bar.txt"); + refute_is_ignored("parent/nested/child6/bar.txt"); + refute_is_ignored("parent/nested/child7/bar.txt"); + assert_is_ignored("padded_parent/child8/bar.txt"); +} + void test_status_ignore__filename_with_cr(void) { int ignored; @@ -957,3 +1010,15 @@ cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "src/SRC/test.txt")); cl_assert_equal_i(icase, ignored); } + +void test_status_ignore__negate_exact_previous(void) +{ + int ignored; + + g_repo = cl_git_sandbox_init("empty_standard_repo"); + + cl_git_mkfile("empty_standard_repo/.gitignore", "*.com\ntags\n!tags/\n.buildpath"); + cl_git_mkfile("empty_standard_repo/.buildpath", ""); + cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, ".buildpath")); + cl_assert_equal_i(1, ignored); +} diff -Nru libgit2-0.22.2/tests/status/renames.c libgit2-0.23.1/tests/status/renames.c --- libgit2-0.22.2/tests/status/renames.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/status/renames.c 2015-08-03 18:07:35.000000000 +0000 @@ -73,16 +73,20 @@ cl_assert_equal_i_fmt(expected->status, actual->status, "%04x"); - if (oldname) - cl_assert(git__strcmp(oldname, expected->oldname) == 0); - else - cl_assert(expected->oldname == NULL); + if (expected->oldname) { + cl_assert(oldname != NULL); + cl_assert_equal_s(oldname, expected->oldname); + } else { + cl_assert(oldname == NULL); + } if (actual->status & (GIT_STATUS_INDEX_RENAMED|GIT_STATUS_WT_RENAMED)) { - if (newname) - cl_assert(git__strcmp(newname, expected->newname) == 0); - else - cl_assert(expected->newname == NULL); + if (expected->newname) { + cl_assert(newname != NULL); + cl_assert_equal_s(newname, expected->newname); + } else { + cl_assert(newname == NULL); + } } } } diff -Nru libgit2-0.22.2/tests/status/submodules.c libgit2-0.23.1/tests/status/submodules.c --- libgit2-0.22.2/tests/status/submodules.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/status/submodules.c 2015-08-03 18:07:35.000000000 +0000 @@ -143,7 +143,7 @@ /* move submodule HEAD to c47800c7266a2be04c571c04d5a6614691ea99bd */ cl_git_pass( git_oid_fromstr(&oid, "c47800c7266a2be04c571c04d5a6614691ea99bd")); - cl_git_pass(git_repository_set_head_detached(smrepo, &oid, NULL, NULL)); + cl_git_pass(git_repository_set_head_detached(smrepo, &oid)); /* first do a normal status, which should now include the submodule */ @@ -503,7 +503,7 @@ cl_git_pass(git_signature_now(&sig, "Sloppy Submoduler", "sloppy@example.com")); cl_git_pass(git_tree_lookup(&tree, repo, &tree_id)); cl_git_pass(git_commit_create(&commit_id, repo, NULL, sig, sig, NULL, "message", tree, 0, NULL)); - cl_git_pass(git_reference_create(&ref, repo, "refs/heads/master", &commit_id, 1, sig, "commit: foo")); + cl_git_pass(git_reference_create(&ref, repo, "refs/heads/master", &commit_id, 1, "commit: foo")); git_reference_free(ref); git_signature_free(sig); } diff -Nru libgit2-0.22.2/tests/status/worktree.c libgit2-0.23.1/tests/status/worktree.c --- libgit2-0.22.2/tests/status/worktree.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/status/worktree.c 2015-08-03 18:07:35.000000000 +0000 @@ -6,6 +6,7 @@ #include "util.h" #include "path.h" #include "../diff/diff_helpers.h" +#include "../checkout/checkout_helpers.h" #include "git2/sys/diff.h" /** @@ -461,14 +462,17 @@ memset(&their_entry, 0x0, sizeof(git_index_entry)); ancestor_entry.path = "modified_file"; + ancestor_entry.mode = 0100644; git_oid_fromstr(&ancestor_entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); our_entry.path = "modified_file"; + our_entry.mode = 0100644; git_oid_fromstr(&our_entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); their_entry.path = "modified_file"; + their_entry.mode = 0100644; git_oid_fromstr(&their_entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); @@ -484,7 +488,7 @@ cl_git_pass(git_status_file(&status, repo, "modified_file")); - cl_assert_equal_i(GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_NEW, status); + cl_assert_equal_i(GIT_STATUS_CONFLICTED, status); } static const char *filemode_paths[] = { @@ -614,14 +618,17 @@ memset(&our_entry, 0x0, sizeof(git_index_entry)); memset(&their_entry, 0x0, sizeof(git_index_entry)); + ancestor_entry.mode = 0100644; ancestor_entry.path = "modified_file"; git_oid_fromstr(&ancestor_entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); + our_entry.mode = 0100644; our_entry.path = "modified_file"; git_oid_fromstr(&our_entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); + their_entry.mode = 0100644; their_entry.path = "modified_file"; git_oid_fromstr(&their_entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a"); @@ -634,11 +641,57 @@ &our_entry, &their_entry)); cl_git_pass(git_status_file(&status, repo, "modified_file")); - cl_assert_equal_i(GIT_STATUS_WT_MODIFIED, status); + cl_assert_equal_i(GIT_STATUS_CONFLICTED, status); git_index_free(index); } +void test_status_worktree__conflict_has_no_oid(void) +{ + git_repository *repo = cl_git_sandbox_init("status"); + git_index *index; + git_index_entry entry = {{0}}; + git_status_list *statuslist; + const git_status_entry *status; + git_oid zero_id = {{0}}; + + entry.mode = 0100644; + entry.path = "modified_file"; + git_oid_fromstr(&entry.id, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"); + + cl_git_pass(git_repository_index(&index, repo)); + cl_git_pass(git_index_conflict_add(index, &entry, &entry, &entry)); + + git_status_list_new(&statuslist, repo, NULL); + + cl_assert_equal_i(16, git_status_list_entrycount(statuslist)); + + status = git_status_byindex(statuslist, 2); + + cl_assert_equal_i(GIT_STATUS_CONFLICTED, status->status); + cl_assert_equal_s("modified_file", status->head_to_index->old_file.path); + cl_assert(!git_oid_equal(&zero_id, &status->head_to_index->old_file.id)); + cl_assert(0 != status->head_to_index->old_file.mode); + cl_assert_equal_s("modified_file", status->head_to_index->new_file.path); + cl_assert_equal_oid(&zero_id, &status->head_to_index->new_file.id); + cl_assert_equal_i(0, status->head_to_index->new_file.mode); + cl_assert_equal_i(0, status->head_to_index->new_file.size); + + cl_assert_equal_s("modified_file", status->index_to_workdir->old_file.path); + cl_assert_equal_oid(&zero_id, &status->index_to_workdir->old_file.id); + cl_assert_equal_i(0, status->index_to_workdir->old_file.mode); + cl_assert_equal_i(0, status->index_to_workdir->old_file.size); + cl_assert_equal_s("modified_file", status->index_to_workdir->new_file.path); + cl_assert( + !git_oid_equal(&zero_id, &status->index_to_workdir->new_file.id) || + !(status->index_to_workdir->new_file.flags & GIT_DIFF_FLAG_VALID_ID)); + cl_assert(0 != status->index_to_workdir->new_file.mode); + cl_assert(0 != status->index_to_workdir->new_file.size); + + git_index_free(index); + git_status_list_free(statuslist); +} + static void stage_and_commit(git_repository *repo, const char *path) { git_index *index; @@ -904,6 +957,7 @@ git_status_options opts = GIT_STATUS_OPTIONS_INIT; git_status_list *status; git_diff_perfdata perf = GIT_DIFF_PERFDATA_INIT; + git_index *index; opts.flags = GIT_STATUS_OPT_DEFAULTS; @@ -915,6 +969,10 @@ git_status_list_free(status); + /* tick the index so we avoid recalculating racily-clean entries */ + cl_git_pass(git_repository_index__weakptr(&index, repo)); + tick_index(index); + opts.flags |= GIT_STATUS_OPT_UPDATE_INDEX; cl_git_pass(git_status_list_new(&status, repo, &opts)); @@ -927,6 +985,8 @@ opts.flags &= ~GIT_STATUS_OPT_UPDATE_INDEX; + /* tick again as the index updating from the previous diff might have reset the timestamp */ + tick_index(index); cl_git_pass(git_status_list_new(&status, repo, &opts)); check_status0(status); cl_git_pass(git_status_list_get_perfdata(&perf, status)); @@ -1038,3 +1098,51 @@ cl_assert_equal_i(0, counts.wrong_sorted_path); } +void test_status_worktree__update_index_with_symlink_doesnt_change_mode(void) +{ + git_repository *repo = cl_git_sandbox_init("testrepo"); + git_reference *head; + git_object *head_object; + git_index *index; + const git_index_entry *idx_entry; + git_status_options opts = GIT_STATUS_OPTIONS_INIT; + status_entry_counts counts = {0}; + const char *expected_paths[] = { "README" }; + const unsigned int expected_statuses[] = {GIT_STATUS_WT_NEW}; + + opts.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR; + opts.flags = GIT_STATUS_OPT_DEFAULTS | GIT_STATUS_OPT_UPDATE_INDEX; + + cl_git_pass(git_repository_head(&head, repo)); + cl_git_pass(git_reference_peel(&head_object, head, GIT_OBJ_COMMIT)); + + cl_git_pass(git_reset(repo, head_object, GIT_RESET_HARD, NULL)); + + cl_git_rewritefile("testrepo/README", "This was rewritten."); + + /* this status rewrites the index because we have changed the + * contents of a tracked file + */ + counts.expected_entry_count = 1; + counts.expected_paths = expected_paths; + counts.expected_statuses = expected_statuses; + + cl_git_pass( + git_status_foreach_ext(repo, &opts, cb_status__normal, &counts)); + cl_assert_equal_i(1, counts.entry_count); + + /* now ensure that the status's rewrite of the index did not screw + * up the mode of the symlink `link_to_new.txt`, particularly + * on platforms that don't support symlinks + */ + cl_git_pass(git_repository_index(&index, repo)); + cl_git_pass(git_index_read(index, true)); + + cl_assert(idx_entry = git_index_get_bypath(index, "link_to_new.txt", 0)); + cl_assert(S_ISLNK(idx_entry->mode)); + + git_index_free(index); + git_object_free(head_object); + git_reference_free(head); +} + diff -Nru libgit2-0.22.2/tests/stress/diff.c libgit2-0.23.1/tests/stress/diff.c --- libgit2-0.22.2/tests/stress/diff.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/stress/diff.c 2015-08-03 18:07:35.000000000 +0000 @@ -37,7 +37,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(expected_new + 1, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(expected_new + 2, exp.files); @@ -47,7 +47,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); cl_assert_equal_i(expected_new, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(expected_new + 1, exp.files); @@ -63,7 +63,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_DELETED]); cl_assert_equal_i(expected_new + 1, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(expected_new + 2, exp.files); @@ -73,7 +73,7 @@ memset(&exp, 0, sizeof(exp)); cl_git_pass(git_diff_foreach( - diff, diff_file_cb, NULL, NULL, &exp)); + diff, diff_file_cb, NULL, NULL, NULL, &exp)); cl_assert_equal_i(1, exp.file_status[GIT_DELTA_RENAMED]); cl_assert_equal_i(expected_new, exp.file_status[GIT_DELTA_ADDED]); cl_assert_equal_i(expected_new + 1, exp.files); diff -Nru libgit2-0.22.2/tests/structinit/structinit.c libgit2-0.23.1/tests/structinit/structinit.c --- libgit2-0.22.2/tests/structinit/structinit.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/structinit/structinit.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,133 +0,0 @@ -#include "clar_libgit2.h" -#include -#include -#include -#include - -#define STRINGIFY(s) #s - -/* Checks two conditions for the specified structure: - * 1. That the initializers for the latest version produces the same - * in-memory representation. - * 2. That the function-based initializer supports all versions from 1...n, - * where n is the latest version (often represented by GIT_*_VERSION). - * - * Parameters: - * structname: The name of the structure to test, e.g. git_blame_options. - * structver: The latest version of the specified structure. - * macroinit: The macro that initializes the latest version of the structure. - * funcinitname: The function that initializes the structure. Must have the - * signature "int (structname* instance, int version)". - */ -#define CHECK_MACRO_FUNC_INIT_EQUAL(structname, structver, macroinit, funcinitname) \ -do { \ - structname structname##_macro_latest = macroinit; \ - structname structname##_func_latest; \ - int structname##_curr_ver = structver - 1; \ - cl_git_pass(funcinitname(&structname##_func_latest, structver)); \ - cl_check_( \ - memcmp(&structname##_macro_latest, &structname##_func_latest, \ - sizeof(structname)) == 0, \ - "Macro-based and function-based initializer for " STRINGIFY(structname) \ - " are not equivalent."); \ - \ - while (structname##_curr_ver > 0) \ - { \ - structname macro; \ - cl_git_pass(funcinitname(¯o, structname##_curr_ver)); \ - structname##_curr_ver--; \ - }\ -} while(0) - -void test_structinit_structinit__compare(void) -{ - /* blame */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_blame_options, GIT_BLAME_OPTIONS_VERSION, \ - GIT_BLAME_OPTIONS_INIT, git_blame_init_options); - - /* checkout */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, \ - GIT_CHECKOUT_OPTIONS_INIT, git_checkout_init_options); - - /* clone */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_clone_options, GIT_CLONE_OPTIONS_VERSION, \ - GIT_CLONE_OPTIONS_INIT, git_clone_init_options); - - /* diff */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_diff_options, GIT_DIFF_OPTIONS_VERSION, \ - GIT_DIFF_OPTIONS_INIT, git_diff_init_options); - - /* diff_find */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_diff_find_options, GIT_DIFF_FIND_OPTIONS_VERSION, \ - GIT_DIFF_FIND_OPTIONS_INIT, git_diff_find_init_options); - - /* merge_file_input */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_merge_file_input, GIT_MERGE_FILE_INPUT_VERSION, \ - GIT_MERGE_FILE_INPUT_INIT, git_merge_file_init_input); - - /* merge_file */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_merge_file_options, GIT_MERGE_FILE_OPTIONS_VERSION, \ - GIT_MERGE_FILE_OPTIONS_INIT, git_merge_file_init_options); - - /* merge_tree */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_merge_options, GIT_MERGE_OPTIONS_VERSION, \ - GIT_MERGE_OPTIONS_INIT, git_merge_init_options); - - /* push */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_push_options, GIT_PUSH_OPTIONS_VERSION, \ - GIT_PUSH_OPTIONS_INIT, git_push_init_options); - - /* remote */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_remote_callbacks, GIT_REMOTE_CALLBACKS_VERSION, \ - GIT_REMOTE_CALLBACKS_INIT, git_remote_init_callbacks); - - /* repository_init */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_repository_init_options, GIT_REPOSITORY_INIT_OPTIONS_VERSION, \ - GIT_REPOSITORY_INIT_OPTIONS_INIT, git_repository_init_init_options); - - /* revert */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_revert_options, GIT_REVERT_OPTIONS_VERSION, \ - GIT_REVERT_OPTIONS_INIT, git_revert_init_options); - - /* status */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_status_options, GIT_STATUS_OPTIONS_VERSION, \ - GIT_STATUS_OPTIONS_INIT, git_status_init_options); - - /* transport */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_transport, GIT_TRANSPORT_VERSION, \ - GIT_TRANSPORT_INIT, git_transport_init); - - /* config_backend */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_config_backend, GIT_CONFIG_BACKEND_VERSION, \ - GIT_CONFIG_BACKEND_INIT, git_config_init_backend); - - /* odb_backend */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_odb_backend, GIT_ODB_BACKEND_VERSION, \ - GIT_ODB_BACKEND_INIT, git_odb_init_backend); - - /* refdb_backend */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_refdb_backend, GIT_REFDB_BACKEND_VERSION, \ - GIT_REFDB_BACKEND_INIT, git_refdb_init_backend); - - /* submodule update */ - CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_submodule_update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \ - GIT_SUBMODULE_UPDATE_OPTIONS_INIT, git_submodule_update_init_options); -} diff -Nru libgit2-0.22.2/tests/submodule/add.c libgit2-0.23.1/tests/submodule/add.c --- libgit2-0.22.2/tests/submodule/add.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/add.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,7 +2,9 @@ #include "posix.h" #include "path.h" #include "submodule_helpers.h" +#include "config/config_helpers.h" #include "fileops.h" +#include "repository.h" static git_repository *g_repo = NULL; @@ -13,26 +15,19 @@ static void assert_submodule_url(const char* name, const char *url) { - git_config *cfg; - const char *s; git_buf key = GIT_BUF_INIT; - cl_git_pass(git_repository_config(&cfg, g_repo)); cl_git_pass(git_buf_printf(&key, "submodule.%s.url", name)); - cl_git_pass(git_config_get_string(&s, cfg, git_buf_cstr(&key))); - cl_assert_equal_s(s, url); + assert_config_entry_value(g_repo, git_buf_cstr(&key), url); - git_config_free(cfg); git_buf_free(&key); } void test_submodule_add__url_absolute(void) { git_submodule *sm; - git_config *cfg; git_repository *repo; - const char *worktree_path; git_buf dot_git_content = GIT_BUF_INIT; g_repo = setup_fixture_submod2(); @@ -59,15 +54,12 @@ cl_git_pass(git_repository_open(&repo, "submod2/" "sm_libgit2")); /* Verify worktree path is relative */ - cl_git_pass(git_repository_config(&cfg, repo)); - cl_git_pass(git_config_get_string(&worktree_path, cfg, "core.worktree")); - cl_assert_equal_s("../../../sm_libgit2/", worktree_path); + assert_config_entry_value(repo, "core.worktree", "../../../sm_libgit2/"); /* Verify gitdir path is relative */ cl_git_pass(git_futils_readbuffer(&dot_git_content, "submod2/" "sm_libgit2" "/.git")); cl_assert_equal_s("gitdir: ../.git/modules/sm_libgit2/", dot_git_content.ptr); - git_config_free(cfg); git_repository_free(repo); git_buf_free(&dot_git_content); diff -Nru libgit2-0.22.2/tests/submodule/init.c libgit2-0.23.1/tests/submodule/init.c --- libgit2-0.22.2/tests/submodule/init.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/init.c 2015-08-03 18:07:35.000000000 +0000 @@ -23,10 +23,10 @@ cl_assert(git_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0); cl_git_pass(git_buf_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git")); - cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); - /* write the absolute url to the .gitmodules file*/ - cl_git_pass(git_submodule_set_url(sm, absolute_url.ptr)); + cl_git_pass(git_submodule_set_url(g_repo, "testrepo", absolute_url.ptr)); + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); /* verify that the .gitmodules is set with an absolute path*/ cl_assert_equal_s(absolute_url.ptr, git_submodule_url(sm)); @@ -34,9 +34,9 @@ /* init and verify that absolute path is written to .git/config */ cl_git_pass(git_submodule_init(sm, false)); - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_snapshot(&cfg, g_repo)); - git_config_get_string(&config_url, cfg, "submodule.testrepo.url"); + cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url")); cl_assert_equal_s(absolute_url.ptr, config_url); git_buf_free(&absolute_url); @@ -64,9 +64,9 @@ /* init and verify that absolute path is written to .git/config */ cl_git_pass(git_submodule_init(sm, false)); - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_snapshot(&cfg, g_repo)); - git_config_get_string(&config_url, cfg, "submodule.testrepo.url"); + cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url")); cl_assert_equal_s(absolute_url.ptr, config_url); git_buf_free(&absolute_url); @@ -89,7 +89,7 @@ cl_git_pass(git_repository_head(&head_ref, g_repo)); cl_git_pass(git_reference_peel(&head_commit, head_ref, GIT_OBJ_COMMIT)); - cl_git_pass(git_repository_set_head_detached(g_repo, git_commit_id((git_commit *)head_commit), NULL, NULL)); + cl_git_pass(git_repository_set_head_detached(g_repo, git_commit_id((git_commit *)head_commit))); cl_assert(git_path_dirname_r(&absolute_url, git_repository_workdir(g_repo)) > 0); cl_git_pass(git_buf_joinpath(&absolute_url, absolute_url.ptr, "testrepo.git")); @@ -102,9 +102,9 @@ /* init and verify that absolute path is written to .git/config */ cl_git_pass(git_submodule_init(sm, false)); - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_snapshot(&cfg, g_repo)); - git_config_get_string(&config_url, cfg, "submodule.testrepo.url"); + cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url")); cl_assert_equal_s(absolute_url.ptr, config_url); git_buf_free(&absolute_url); diff -Nru libgit2-0.22.2/tests/submodule/lookup.c libgit2-0.23.1/tests/submodule/lookup.c --- libgit2-0.22.2/tests/submodule/lookup.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/lookup.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,6 +1,7 @@ #include "clar_libgit2.h" #include "submodule_helpers.h" #include "git2/sys/repository.h" +#include "repository.h" #include "fileops.h" static git_repository *g_repo = NULL; @@ -31,6 +32,9 @@ /* lookup non-existent item */ refute_submodule_exists(g_repo, "no_such_file", GIT_ENOTFOUND); + + /* lookup a submodule by path with a trailing slash */ + assert_submodule_exists(g_repo, "sm_added_and_uncommited/"); } void test_submodule_lookup__accessors(void) @@ -100,10 +104,27 @@ void test_submodule_lookup__foreach(void) { + git_config *cfg; sm_lookup_data data; + memset(&data, 0, sizeof(data)); cl_git_pass(git_submodule_foreach(g_repo, sm_lookup_cb, &data)); cl_assert_equal_i(8, data.count); + + memset(&data, 0, sizeof(data)); + + /* Change the path for a submodule so it doesn't match the name */ + cl_git_pass(git_config_open_ondisk(&cfg, "submod2/.gitmodules")); + + cl_git_pass(git_config_set_string(cfg, "submodule.smchangedindex.path", "sm_changed_index")); + cl_git_pass(git_config_set_string(cfg, "submodule.smchangedindex.url", "../submod2_target")); + cl_git_pass(git_config_delete_entry(cfg, "submodule.sm_changed_index.path")); + cl_git_pass(git_config_delete_entry(cfg, "submodule.sm_changed_index.url")); + + git_config_free(cfg); + + cl_git_pass(git_submodule_foreach(g_repo, sm_lookup_cb, &data)); + cl_assert_equal_i(8, data.count); } void test_submodule_lookup__lookup_even_with_unborn_head(void) @@ -112,7 +133,7 @@ /* put us on an unborn branch */ cl_git_pass(git_reference_symbolic_create( - &head, g_repo, "HEAD", "refs/heads/garbage", 1, NULL, NULL)); + &head, g_repo, "HEAD", "refs/heads/garbage", 1, NULL)); git_reference_free(head); test_submodule_lookup__simple_lookup(); /* baseline should still pass */ @@ -130,6 +151,29 @@ test_submodule_lookup__simple_lookup(); /* baseline should still pass */ } +void test_submodule_lookup__backslashes(void) +{ + git_config *cfg; + git_submodule *sm; + git_repository *subrepo; + git_buf buf = GIT_BUF_INIT; + const char *backslashed_path = "..\\submod2_target"; + + cl_git_pass(git_config_open_ondisk(&cfg, "submod2/.gitmodules")); + cl_git_pass(git_config_set_string(cfg, "submodule.sm_unchanged.url", backslashed_path)); + git_config_free(cfg); + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_unchanged")); + cl_assert_equal_s(backslashed_path, git_submodule_url(sm)); + cl_git_pass(git_submodule_open(&subrepo, sm)); + + cl_git_pass(git_submodule_resolve_url(&buf, g_repo, backslashed_path)); + + git_buf_free(&buf); + git_submodule_free(sm); + git_repository_free(subrepo); +} + static void baseline_tests(void) { /* small baseline that should work even if we change the index or make @@ -259,13 +303,33 @@ assert_submodule_exists(g_repo, "sm_just_added_head"); { - git_signature *sig; - cl_git_pass(git_signature_now(&sig, "resetter", "resetter@email.com")); - cl_git_pass(git_reference_create(NULL, g_repo, "refs/heads/master", git_reference_target(original_head), 1, sig, "move head back")); - git_signature_free(sig); + cl_git_pass(git_reference_create(NULL, g_repo, "refs/heads/master", git_reference_target(original_head), 1, "move head back")); git_reference_free(original_head); } refute_submodule_exists(g_repo, "sm_just_added_head", GIT_EEXISTS); } +/* Test_App and Test_App2 are fairly similar names, make sure we load the right one */ +void test_submodule_lookup__prefix_name(void) +{ + git_submodule *sm; + + cl_git_rewritefile("submod2/.gitmodules", + "[submodule \"Test_App\"]\n" + " path = Test_App\n" + " url = ../Test_App\n" + "[submodule \"Test_App2\"]\n" + " path = Test_App2\n" + " url = ../Test_App\n"); + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "Test_App")); + cl_assert_equal_s("Test_App", git_submodule_name(sm)); + + git_submodule_free(sm); + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "Test_App2")); + cl_assert_equal_s("Test_App2", git_submodule_name(sm)); + + git_submodule_free(sm); +} diff -Nru libgit2-0.22.2/tests/submodule/modify.c libgit2-0.23.1/tests/submodule/modify.c --- libgit2-0.22.2/tests/submodule/modify.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/modify.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,11 +2,13 @@ #include "posix.h" #include "path.h" #include "submodule_helpers.h" +#include "config/config_helpers.h" static git_repository *g_repo = NULL; -#define SM_LIBGIT2_URL "https://github.com/libgit2/libgit2.git" -#define SM_LIBGIT2 "sm_libgit2" +#define SM_LIBGIT2_URL "https://github.com/libgit2/libgit2.git" +#define SM_LIBGIT2_BRANCH "github-branch" +#define SM_LIBGIT2 "sm_libgit2" void test_submodule_modify__initialize(void) { @@ -39,19 +41,17 @@ git_config_free(cfg); /* confirm no submodule data in config */ - cl_git_pass(git_repository_config(&cfg, g_repo)); - cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_unchanged.url")); - cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_changed_head.url")); - cl_git_fail(git_config_get_string(&str, cfg, "submodule.sm_added_and_uncommited.url")); + cl_git_pass(git_repository_config_snapshot(&cfg, g_repo)); + cl_git_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_unchanged.url")); + cl_git_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_changed_head.url")); + cl_git_fail_with(GIT_ENOTFOUND, git_config_get_string(&str, cfg, "submodule.sm_added_and_uncommited.url")); git_config_free(cfg); /* call init and see that settings are copied */ cl_git_pass(git_submodule_foreach(g_repo, init_one_submodule, NULL)); - git_submodule_reload_all(g_repo, 1); - /* confirm submodule data in config */ - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_snapshot(&cfg, g_repo)); cl_git_pass(git_config_get_string(&str, cfg, "submodule.sm_unchanged.url")); cl_assert(git__suffixcmp(str, "/submod2_target") == 0); cl_git_pass(git_config_get_string(&str, cfg, "submodule.sm_changed_head.url")); @@ -72,20 +72,12 @@ static void assert_submodule_url_is_synced( git_submodule *sm, const char *parent_key, const char *child_key) { - git_config *cfg; - const char *str; git_repository *smrepo; - cl_git_pass(git_repository_config(&cfg, g_repo)); - cl_git_pass(git_config_get_string(&str, cfg, parent_key)); - cl_assert_equal_s(git_submodule_url(sm), str); - git_config_free(cfg); + assert_config_entry_value(g_repo, parent_key, git_submodule_url(sm)); cl_git_pass(git_submodule_open(&smrepo, sm)); - cl_git_pass(git_repository_config(&cfg, smrepo)); - cl_git_pass(git_config_get_string(&str, cfg, child_key)); - cl_assert_equal_s(git_submodule_url(sm), str); - git_config_free(cfg); + assert_config_entry_value(smrepo, child_key, git_submodule_url(sm)); git_repository_free(smrepo); } @@ -111,7 +103,7 @@ */ /* check submodule info does not match before sync */ - cl_git_pass(git_repository_config(&cfg, g_repo)); + cl_git_pass(git_repository_config_snapshot(&cfg, g_repo)); cl_git_pass(git_config_get_string(&str, cfg, "submodule."SM1".url")); cl_assert(strcmp(git_submodule_url(sm1), str) != 0); cl_git_pass(git_config_get_string(&str, cfg, "submodule."SM2".url")); @@ -125,121 +117,96 @@ /* check that submodule config is updated */ assert_submodule_url_is_synced( - sm1, "submodule."SM1".url", "branch.origin.remote"); + sm1, "submodule."SM1".url", "remote.origin.url"); assert_submodule_url_is_synced( - sm2, "submodule."SM2".url", "branch.origin.remote"); + sm2, "submodule."SM2".url", "remote.origin.url"); assert_submodule_url_is_synced( - sm3, "submodule."SM3".url", "branch.origin.remote"); + sm3, "submodule."SM3".url", "remote.origin.url"); git_submodule_free(sm1); git_submodule_free(sm2); git_submodule_free(sm3); } -void test_submodule_modify__edit_and_save(void) +void assert_ignore_change(git_submodule_ignore_t ignore) { - git_submodule *sm1, *sm2; - char *old_url; - git_submodule_ignore_t old_ignore; - git_submodule_update_t old_update; - git_repository *r2; - git_submodule_recurse_t old_fetchrecurse; - - cl_git_pass(git_submodule_lookup(&sm1, g_repo, "sm_changed_head")); - - old_url = git__strdup(git_submodule_url(sm1)); - - /* modify properties of submodule */ - cl_git_pass(git_submodule_set_url(sm1, SM_LIBGIT2_URL)); - old_ignore = git_submodule_set_ignore(sm1, GIT_SUBMODULE_IGNORE_UNTRACKED); - old_update = git_submodule_set_update(sm1, GIT_SUBMODULE_UPDATE_REBASE); - old_fetchrecurse = git_submodule_set_fetch_recurse_submodules( - sm1, GIT_SUBMODULE_RECURSE_YES); - - cl_assert_equal_s(SM_LIBGIT2_URL, git_submodule_url(sm1)); - cl_assert_equal_i( - GIT_SUBMODULE_IGNORE_UNTRACKED, git_submodule_ignore(sm1)); - cl_assert_equal_i( - GIT_SUBMODULE_UPDATE_REBASE, git_submodule_update_strategy(sm1)); - cl_assert_equal_i( - GIT_SUBMODULE_RECURSE_YES, git_submodule_fetch_recurse_submodules(sm1)); - - /* revert without saving (and confirm setters return old value) */ - cl_git_pass(git_submodule_set_url(sm1, old_url)); - cl_assert_equal_i( - GIT_SUBMODULE_IGNORE_UNTRACKED, - git_submodule_set_ignore(sm1, GIT_SUBMODULE_IGNORE_RESET)); - cl_assert_equal_i( - GIT_SUBMODULE_UPDATE_REBASE, - git_submodule_set_update(sm1, GIT_SUBMODULE_UPDATE_RESET)); - cl_assert_equal_i( - GIT_SUBMODULE_RECURSE_YES, git_submodule_set_fetch_recurse_submodules( - sm1, GIT_SUBMODULE_RECURSE_RESET)); - - /* check that revert was successful */ - cl_assert_equal_s(old_url, git_submodule_url(sm1)); - cl_assert_equal_i((int)old_ignore, (int)git_submodule_ignore(sm1)); - cl_assert_equal_i((int)old_update, (int)git_submodule_update_strategy(sm1)); - cl_assert_equal_i( - old_fetchrecurse, git_submodule_fetch_recurse_submodules(sm1)); - - /* modify properties of submodule (again) */ - cl_git_pass(git_submodule_set_url(sm1, SM_LIBGIT2_URL)); - git_submodule_set_ignore(sm1, GIT_SUBMODULE_IGNORE_UNTRACKED); - git_submodule_set_update(sm1, GIT_SUBMODULE_UPDATE_REBASE); - git_submodule_set_fetch_recurse_submodules(sm1, GIT_SUBMODULE_RECURSE_YES); - - /* call save */ - cl_git_pass(git_submodule_save(sm1)); - - /* attempt to "revert" values */ - git_submodule_set_ignore(sm1, GIT_SUBMODULE_IGNORE_RESET); - git_submodule_set_update(sm1, GIT_SUBMODULE_UPDATE_RESET); + git_submodule *sm; - /* but ignore and update should NOT revert because the RESET - * should now be the newly saved value... - */ - cl_assert_equal_i( - (int)GIT_SUBMODULE_IGNORE_UNTRACKED, (int)git_submodule_ignore(sm1)); - cl_assert_equal_i( - (int)GIT_SUBMODULE_UPDATE_REBASE, (int)git_submodule_update_strategy(sm1)); - cl_assert_equal_i(GIT_SUBMODULE_RECURSE_YES, git_submodule_fetch_recurse_submodules(sm1)); - - /* call reload and check that the new values are loaded */ - cl_git_pass(git_submodule_reload(sm1, 0)); - - cl_assert_equal_s(SM_LIBGIT2_URL, git_submodule_url(sm1)); - cl_assert_equal_i( - (int)GIT_SUBMODULE_IGNORE_UNTRACKED, (int)git_submodule_ignore(sm1)); - cl_assert_equal_i( - (int)GIT_SUBMODULE_UPDATE_REBASE, (int)git_submodule_update_strategy(sm1)); - cl_assert_equal_i(GIT_SUBMODULE_RECURSE_YES, git_submodule_fetch_recurse_submodules(sm1)); - - /* open a second copy of the repo and compare submodule */ - cl_git_pass(git_repository_open(&r2, "submod2")); - cl_git_pass(git_submodule_lookup(&sm2, r2, "sm_changed_head")); - - cl_assert_equal_s(SM_LIBGIT2_URL, git_submodule_url(sm2)); - cl_assert_equal_i( - GIT_SUBMODULE_IGNORE_UNTRACKED, git_submodule_ignore(sm2)); - cl_assert_equal_i( - GIT_SUBMODULE_UPDATE_REBASE, git_submodule_update_strategy(sm2)); - cl_assert_equal_i( - GIT_SUBMODULE_RECURSE_NO, git_submodule_fetch_recurse_submodules(sm2)); - - /* set fetchRecurseSubmodules on-demand */ - cl_git_pass(git_submodule_reload(sm1, 0)); - git_submodule_set_fetch_recurse_submodules(sm1, GIT_SUBMODULE_RECURSE_ONDEMAND); - cl_assert_equal_i( - GIT_SUBMODULE_RECURSE_ONDEMAND, git_submodule_fetch_recurse_submodules(sm1)); - /* call save */ - cl_git_pass(git_submodule_save(sm1)); - cl_git_pass(git_submodule_reload(sm1, 0)); - cl_assert_equal_i( - GIT_SUBMODULE_RECURSE_ONDEMAND, git_submodule_fetch_recurse_submodules(sm1)); + cl_git_pass(git_submodule_set_ignore(g_repo, "sm_changed_head", ignore)); - git_submodule_free(sm1); - git_submodule_free(sm2); - git_repository_free(r2); - git__free(old_url); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert_equal_i(ignore, git_submodule_ignore(sm)); + git_submodule_free(sm); +} + +void test_submodule_modify__set_ignore(void) +{ + assert_ignore_change(GIT_SUBMODULE_IGNORE_UNTRACKED); + assert_ignore_change(GIT_SUBMODULE_IGNORE_NONE); + assert_ignore_change(GIT_SUBMODULE_IGNORE_ALL); +} + +void assert_update_change(git_submodule_update_t update) +{ + git_submodule *sm; + + cl_git_pass(git_submodule_set_update(g_repo, "sm_changed_head", update)); + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert_equal_i(update, git_submodule_update_strategy(sm)); + git_submodule_free(sm); +} + +void test_submodule_modify__set_update(void) +{ + assert_update_change(GIT_SUBMODULE_UPDATE_REBASE); + assert_update_change(GIT_SUBMODULE_UPDATE_NONE); + assert_update_change(GIT_SUBMODULE_UPDATE_CHECKOUT); +} + +void assert_recurse_change(git_submodule_recurse_t recurse) +{ + git_submodule *sm; + + cl_git_pass(git_submodule_set_fetch_recurse_submodules(g_repo, "sm_changed_head", recurse)); + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert_equal_i(recurse, git_submodule_fetch_recurse_submodules(sm)); + git_submodule_free(sm); +} + +void test_submodule_modify__set_fetch_recurse_submodules(void) +{ + assert_recurse_change(GIT_SUBMODULE_RECURSE_YES); + assert_recurse_change(GIT_SUBMODULE_RECURSE_NO); + assert_recurse_change(GIT_SUBMODULE_RECURSE_ONDEMAND); +} + +void test_submodule_modify__set_branch(void) +{ + git_submodule *sm; + + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert(git_submodule_branch(sm) == NULL); + git_submodule_free(sm); + + cl_git_pass(git_submodule_set_branch(g_repo, "sm_changed_head", SM_LIBGIT2_BRANCH)); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert_equal_s(SM_LIBGIT2_BRANCH, git_submodule_branch(sm)); + git_submodule_free(sm); + + cl_git_pass(git_submodule_set_branch(g_repo, "sm_changed_head", NULL)); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert(git_submodule_branch(sm) == NULL); + git_submodule_free(sm); +} + +void test_submodule_modify__set_url(void) +{ + git_submodule *sm; + + cl_git_pass(git_submodule_set_url(g_repo, "sm_changed_head", SM_LIBGIT2_URL)); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "sm_changed_head")); + cl_assert_equal_s(SM_LIBGIT2_URL, git_submodule_url(sm)); + git_submodule_free(sm); } diff -Nru libgit2-0.22.2/tests/submodule/nosubs.c libgit2-0.23.1/tests/submodule/nosubs.c --- libgit2-0.22.2/tests/submodule/nosubs.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/nosubs.c 2015-08-03 18:07:35.000000000 +0000 @@ -21,19 +21,11 @@ cl_assert_equal_i(GIT_EEXISTS, git_submodule_lookup(&sm, repo, "subrepo")); - cl_git_pass(git_submodule_reload_all(repo, 0)); - cl_assert_equal_i(GIT_ENOTFOUND, git_submodule_lookup(&sm, repo, "subdir")); cl_assert_equal_i(GIT_EEXISTS, git_submodule_lookup(&sm, repo, "subrepo")); } -void test_submodule_nosubs__immediate_reload(void) -{ - git_repository *repo = cl_git_sandbox_init("status"); - cl_git_pass(git_submodule_reload_all(repo, 0)); -} - static int fake_submod_cb(git_submodule *sm, const char *n, void *p) { GIT_UNUSED(sm); GIT_UNUSED(n); GIT_UNUSED(p); @@ -57,41 +49,7 @@ git_submodule_free(sm2); cl_git_pass(git_submodule_foreach(repo, fake_submod_cb, NULL)); - cl_git_pass(git_submodule_reload_all(repo, 0)); - - git_submodule_free(sm); -} - -void test_submodule_nosubs__reload_add_reload(void) -{ - git_repository *repo = cl_git_sandbox_init("status"); - git_submodule *sm; - cl_git_pass(git_submodule_reload_all(repo, 0)); - - /* try one add with a reload (to make sure no errors happen) */ - - cl_git_pass(git_submodule_add_setup(&sm, repo, - "https://github.com/libgit2/libgit2.git", "submodules/libgit2", 1)); - - cl_git_pass(git_submodule_reload_all(repo, 0)); - - cl_assert_equal_s("submodules/libgit2", git_submodule_name(sm)); - git_submodule_free(sm); - - cl_git_pass(git_submodule_lookup(&sm, repo, "submodules/libgit2")); - cl_assert_equal_s("submodules/libgit2", git_submodule_name(sm)); - git_submodule_free(sm); - - /* try one add without a reload (to make sure cache inval works, too) */ - - cl_git_pass(git_submodule_add_setup(&sm, repo, - "https://github.com/libgit2/libgit2.git", "libgit2-again", 1)); - cl_assert_equal_s("libgit2-again", git_submodule_name(sm)); - git_submodule_free(sm); - - cl_git_pass(git_submodule_lookup(&sm, repo, "libgit2-again")); - cl_assert_equal_s("libgit2-again", git_submodule_name(sm)); git_submodule_free(sm); } @@ -100,10 +58,8 @@ git_repository *repo = cl_git_sandbox_init("status"); cl_git_mkfile("status/.gitmodules", "[submodule \"foobar\"]\tpath=blargle\n\turl=\n\tbranch=\n\tupdate=flooble\n\n"); - cl_git_fail(git_submodule_reload_all(repo, 0)); cl_git_rewritefile("status/.gitmodules", "[submodule \"foobar\"]\tpath=blargle\n\turl=\n\tbranch=\n\tupdate=rebase\n\n"); - cl_git_pass(git_submodule_reload_all(repo, 0)); cl_git_pass(git_submodule_lookup(NULL, repo, "foobar")); cl_assert_equal_i(GIT_ENOTFOUND, git_submodule_lookup(NULL, repo, "subdir")); @@ -115,8 +71,6 @@ git_submodule *sm; git_buf buf = GIT_BUF_INIT; - /* note lack of calls to git_submodule_reload_all - this *should* work */ - cl_git_fail(git_submodule_lookup(NULL, repo, "libgit2")); cl_git_fail(git_submodule_lookup(NULL, repo, "submodules/libgit2")); diff -Nru libgit2-0.22.2/tests/submodule/repository_init.c libgit2-0.23.1/tests/submodule/repository_init.c --- libgit2-0.22.2/tests/submodule/repository_init.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/repository_init.c 2015-08-03 18:07:35.000000000 +0000 @@ -2,6 +2,7 @@ #include "posix.h" #include "path.h" #include "submodule_helpers.h" +#include "config/config_helpers.h" #include "fileops.h" static git_repository *g_repo = NULL; @@ -10,8 +11,6 @@ { git_submodule *sm; git_repository *repo; - git_config *cfg; - const char *worktree_path; git_buf dot_git_content = GIT_BUF_INIT; g_repo = setup_fixture_submod2(); @@ -21,9 +20,7 @@ cl_git_pass(git_submodule_repo_init(&repo, sm, 1)); /* Verify worktree */ - cl_git_pass(git_repository_config(&cfg, repo)); - cl_git_pass(git_config_get_string(&worktree_path, cfg, "core.worktree")); - cl_assert_equal_s("../../../sm_gitmodules_only/", worktree_path); + assert_config_entry_value(repo, "core.worktree", "../../../sm_gitmodules_only/"); /* Verify gitlink */ cl_git_pass(git_futils_readbuffer(&dot_git_content, "submod2/" "sm_gitmodules_only" "/.git")); @@ -35,7 +32,6 @@ cl_assert(git_path_isdir("submod2/.git/modules/" "sm_gitmodules_only")); cl_assert(git_path_isfile("submod2/.git/modules/" "sm_gitmodules_only" "/HEAD")); - git_config_free(cfg); git_submodule_free(sm); git_repository_free(repo); git_buf_free(&dot_git_content); diff -Nru libgit2-0.22.2/tests/submodule/status.c libgit2-0.23.1/tests/submodule/status.c --- libgit2-0.22.2/tests/submodule/status.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/status.c 2015-08-03 18:07:35.000000000 +0000 @@ -107,56 +107,47 @@ cl_assert((status & GIT_SUBMODULE_STATUS_INDEX_DELETED) != 0); } -static int set_sm_ignore(git_submodule *sm, const char *name, void *payload) -{ - git_submodule_ignore_t ignore = *(git_submodule_ignore_t *)payload; - GIT_UNUSED(name); - git_submodule_set_ignore(sm, ignore); - return 0; -} - void test_submodule_status__ignore_untracked(void) { unsigned int status; git_submodule_ignore_t ign = GIT_SUBMODULE_IGNORE_UNTRACKED; rm_submodule("sm_unchanged"); - cl_git_pass(git_submodule_foreach(g_repo, set_sm_ignore, &ign)); refute_submodule_exists(g_repo, "just_a_dir", GIT_ENOTFOUND); refute_submodule_exists(g_repo, "not-submodule", GIT_EEXISTS); refute_submodule_exists(g_repo, "not", GIT_EEXISTS); - status = get_submodule_status(g_repo, "sm_changed_index"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_index", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED) != 0); - status = get_submodule_status(g_repo, "sm_changed_head"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_head", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_MODIFIED) != 0); - status = get_submodule_status(g_repo, "sm_changed_file"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_file", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_WD_MODIFIED) != 0); - status = get_submodule_status(g_repo, "sm_changed_untracked_file"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_untracked_file", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_missing_commits"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_missing_commits", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_MODIFIED) != 0); - status = get_submodule_status(g_repo, "sm_added_and_uncommited"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_added_and_uncommited", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_INDEX_ADDED) != 0); /* removed sm_unchanged for deleted workdir */ - status = get_submodule_status(g_repo, "sm_unchanged"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_DELETED) != 0); /* now mkdir sm_unchanged to test uninitialized */ cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); - status = get_submodule_status(g_repo, "sm_unchanged"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) != 0); /* update sm_changed_head in index */ add_submodule_to_index("sm_changed_head"); - status = get_submodule_status(g_repo, "sm_changed_head"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_head", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_INDEX_MODIFIED) != 0); } @@ -166,42 +157,41 @@ git_submodule_ignore_t ign = GIT_SUBMODULE_IGNORE_DIRTY; rm_submodule("sm_unchanged"); - cl_git_pass(git_submodule_foreach(g_repo, set_sm_ignore, &ign)); refute_submodule_exists(g_repo, "just_a_dir", GIT_ENOTFOUND); refute_submodule_exists(g_repo, "not-submodule", GIT_EEXISTS); refute_submodule_exists(g_repo, "not", GIT_EEXISTS); - status = get_submodule_status(g_repo, "sm_changed_index"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_index", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_changed_head"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_head", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_MODIFIED) != 0); - status = get_submodule_status(g_repo, "sm_changed_file"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_file", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_changed_untracked_file"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_untracked_file", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_missing_commits"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_missing_commits", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_MODIFIED) != 0); - status = get_submodule_status(g_repo, "sm_added_and_uncommited"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_added_and_uncommited", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_INDEX_ADDED) != 0); /* removed sm_unchanged for deleted workdir */ - status = get_submodule_status(g_repo, "sm_unchanged"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_DELETED) != 0); /* now mkdir sm_unchanged to test uninitialized */ cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); - status = get_submodule_status(g_repo, "sm_unchanged"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_WD_UNINITIALIZED) != 0); /* update sm_changed_head in index */ add_submodule_to_index("sm_changed_head"); - status = get_submodule_status(g_repo, "sm_changed_head"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_head", ign)); cl_assert((status & GIT_SUBMODULE_STATUS_INDEX_MODIFIED) != 0); } @@ -211,42 +201,41 @@ git_submodule_ignore_t ign = GIT_SUBMODULE_IGNORE_ALL; rm_submodule("sm_unchanged"); - cl_git_pass(git_submodule_foreach(g_repo, set_sm_ignore, &ign)); refute_submodule_exists(g_repo, "just_a_dir", GIT_ENOTFOUND); refute_submodule_exists(g_repo, "not-submodule", GIT_EEXISTS); refute_submodule_exists(g_repo, "not", GIT_EEXISTS); - status = get_submodule_status(g_repo, "sm_changed_index"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_index", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_changed_head"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_head", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_changed_file"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_file", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_changed_untracked_file"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_untracked_file", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_missing_commits"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_missing_commits", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); - status = get_submodule_status(g_repo, "sm_added_and_uncommited"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_added_and_uncommited", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); /* removed sm_unchanged for deleted workdir */ - status = get_submodule_status(g_repo, "sm_unchanged"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); /* now mkdir sm_unchanged to test uninitialized */ cl_git_pass(git_futils_mkdir("sm_unchanged", "submod2", 0755, 0)); - status = get_submodule_status(g_repo, "sm_unchanged"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_unchanged", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); /* update sm_changed_head in index */ add_submodule_to_index("sm_changed_head"); - status = get_submodule_status(g_repo, "sm_changed_head"); + cl_git_pass(git_submodule_status(&status, g_repo,"sm_changed_head", ign)); cl_assert(GIT_SUBMODULE_STATUS_IS_UNMODIFIED(status)); } diff -Nru libgit2-0.22.2/tests/submodule/submodule_helpers.c libgit2-0.23.1/tests/submodule/submodule_helpers.c --- libgit2-0.22.2/tests/submodule/submodule_helpers.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/submodule_helpers.c 2015-08-03 18:07:35.000000000 +0000 @@ -156,21 +156,18 @@ git_repository *repo, const char *name, int expected_error, const char *msg, const char *file, int line) { - git_submodule *sm; clar__assert_equal( file, line, msg, 1, "%i", - expected_error, (int)(git_submodule_lookup(&sm, repo, name))); + expected_error, (int)(git_submodule_lookup(NULL, repo, name))); } unsigned int get_submodule_status(git_repository *repo, const char *name) { - git_submodule *sm = NULL; unsigned int status = 0; - cl_git_pass(git_submodule_lookup(&sm, repo, name)); - cl_assert(sm); - cl_git_pass(git_submodule_status(&status, sm)); - git_submodule_free(sm); + assert(repo && name); + + cl_git_pass(git_submodule_status(&status, repo, name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)); return status; } diff -Nru libgit2-0.22.2/tests/submodule/update.c libgit2-0.23.1/tests/submodule/update.c --- libgit2-0.22.2/tests/submodule/update.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/submodule/update.c 2015-08-03 18:07:35.000000000 +0000 @@ -96,14 +96,14 @@ update_options.checkout_opts.progress_cb = checkout_progress_cb; update_options.checkout_opts.progress_payload = &update_payload; - update_options.remote_callbacks.update_tips = update_tips; - update_options.remote_callbacks.payload = &update_payload; + update_options.fetch_opts.callbacks.update_tips = update_tips; + update_options.fetch_opts.callbacks.payload = &update_payload; /* get the submodule */ cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); /* verify the initial state of the submodule */ - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -114,7 +114,7 @@ cl_git_pass(git_submodule_update(sm, 0, &update_options)); /* verify state */ - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -142,7 +142,7 @@ /* get the submodule */ cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -177,7 +177,7 @@ /* Initialize and update the sub repository */ cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -196,14 +196,18 @@ cl_git_pass(git_reference_lookup(&branch_reference, g_repo, "refs/heads/alternate_1")); cl_git_pass(git_reference_peel(&branch_commit, branch_reference, GIT_OBJ_COMMIT)); cl_git_pass(git_checkout_tree(g_repo, branch_commit, &checkout_options)); - cl_git_pass(git_repository_set_head(g_repo, git_reference_name(branch_reference), NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, git_reference_name(branch_reference))); /* * Verify state after checkout of parent repository. The submodule ID in the * HEAD commit and index should be updated, but not the workdir. */ - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); + + git_submodule_free(sm); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); + cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -251,7 +255,7 @@ /* Initialize and update the sub repository */ cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -270,14 +274,18 @@ cl_git_pass(git_reference_lookup(&branch_reference, g_repo, "refs/heads/alternate_1")); cl_git_pass(git_reference_peel(&branch_commit, branch_reference, GIT_OBJ_COMMIT)); cl_git_pass(git_checkout_tree(g_repo, branch_commit, &checkout_options)); - cl_git_pass(git_repository_set_head(g_repo, git_reference_name(branch_reference), NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, git_reference_name(branch_reference))); /* * Verify state after checkout of parent repository. The submodule ID in the * HEAD commit and index should be updated, but not the workdir. */ - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); + + git_submodule_free(sm); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); + cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -324,7 +332,7 @@ /* Initialize and update the sub repository */ cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | @@ -343,13 +351,17 @@ cl_git_pass(git_reference_lookup(&branch_reference, g_repo, "refs/heads/alternate_1")); cl_git_pass(git_reference_peel(&branch_commit, branch_reference, GIT_OBJ_COMMIT)); cl_git_pass(git_checkout_tree(g_repo, branch_commit, &checkout_options)); - cl_git_pass(git_repository_set_head(g_repo, git_reference_name(branch_reference), NULL, NULL)); + cl_git_pass(git_repository_set_head(g_repo, git_reference_name(branch_reference))); /* * Verify state after checkout of parent repository. The submodule ID in the * HEAD commit and index should be updated, but not the workdir. */ - cl_git_pass(git_submodule_status(&submodule_status, sm)); + cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED)); + + git_submodule_free(sm); + cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); + cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD | GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_CONFIG | diff -Nru libgit2-0.22.2/tests/threads/refdb.c libgit2-0.23.1/tests/threads/refdb.c --- libgit2-0.22.2/tests/threads/refdb.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/threads/refdb.c 2015-08-03 18:07:35.000000000 +0000 @@ -59,7 +59,7 @@ for (r = 0; r < 200; ++r) { p_snprintf(name, sizeof(name), "refs/heads/direct-%03d", r); - cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL)); git_reference_free(ref); } @@ -103,7 +103,7 @@ for (i = 0; i < 10; ++i) { p_snprintf(name, sizeof(name), "refs/heads/thread-%03d-%02d", *id, i); - cl_git_pass(git_reference_create(&ref[i], g_repo, name, &head, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref[i], g_repo, name, &head, 0, NULL)); if (i == 5) { git_refdb *refdb; @@ -168,7 +168,7 @@ for (r = 0; r < 50; ++r) { p_snprintf(name, sizeof(name), "refs/heads/starter-%03d", r); - cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL, NULL)); + cl_git_pass(git_reference_create(&ref, g_repo, name, &head, 0, NULL)); git_reference_free(ref); } diff -Nru libgit2-0.22.2/tests/trace/trace.c libgit2-0.23.1/tests/trace/trace.c --- libgit2-0.22.2/tests/trace/trace.c 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/tests/trace/trace.c 2015-08-03 18:07:35.000000000 +0000 @@ -1,4 +1,5 @@ #include "clar_libgit2.h" +#include "clar_libgit2_trace.h" #include "trace.h" static int written = 0; @@ -14,6 +15,9 @@ void test_trace_trace__initialize(void) { + /* If global tracing is enabled, disable for the duration of this test. */ + cl_global_trace_disable(); + git_trace_set(GIT_TRACE_INFO, trace_callback); written = 0; } @@ -21,12 +25,17 @@ void test_trace_trace__cleanup(void) { git_trace_set(GIT_TRACE_NONE, NULL); + + /* If global tracing was enabled, restart it. */ + cl_global_trace_register(); } void test_trace_trace__sets(void) { #ifdef GIT_TRACE cl_assert(git_trace_level() == GIT_TRACE_INFO); +#else + cl_skip(); #endif } @@ -42,6 +51,8 @@ git_trace(GIT_TRACE_ERROR, "Hello %s!", "world"); cl_assert(written == 1); +#else + cl_skip(); #endif } @@ -56,6 +67,8 @@ cl_assert(written == 0); git_trace(GIT_TRACE_FATAL, "Hello %s!", "world"); cl_assert(written == 0); +#else + cl_skip(); #endif } @@ -65,6 +78,8 @@ cl_assert(written == 0); git_trace(GIT_TRACE_DEBUG, "Hello %s!", "world"); cl_assert(written == 0); +#else + cl_skip(); #endif } @@ -74,6 +89,8 @@ cl_assert(written == 0); git_trace(GIT_TRACE_INFO, "Hello %s!", "world"); cl_assert(written == 1); +#else + cl_skip(); #endif } @@ -83,5 +100,7 @@ cl_assert(written == 0); git_trace(GIT_TRACE_ERROR, "Hello %s!", "world"); cl_assert(written == 1); +#else + cl_skip(); #endif } diff -Nru libgit2-0.22.2/THREADING.md libgit2-0.23.1/THREADING.md --- libgit2-0.22.2/THREADING.md 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/THREADING.md 2015-08-03 18:07:35.000000000 +0000 @@ -41,18 +41,36 @@ When using libssh2 which itself uses WinCNG, there are no special steps necessary. If you are using a MinGW or similar environment where -libssh2 uses OpenSSL or libgcrypt, then the non-Windows case affects +libssh2 uses OpenSSL or libgcrypt, then the general case affects you. -Non-Windows +On Mac OS X ----------- -On the rest of the platforms, libgit2 uses OpenSSL to be able to use -HTTPS as a transport. This library is made to be thread-implementation -agnostic, and the users of the library must set which locking function -it should use. This means that libgit2 cannot know what to set as the -user of libgit2 may use OpenSSL independently and the locking settings -must survive libgit2 shutting down. +By default we use libcurl to perform the encryption. The +system-provided libcurl uses SecureTransport, so no special steps are +necessary. If you link against another libcurl (e.g. from homebrew) +refer to the general case. + +If the option to use libcurl was deactivated, the library makes use of +CommonCrypto and SecureTransport for cryptographic support. These are +thread-safe and you do not need to do anything special. + +Note that libssh2 may still use OpenSSL itself. In that case, the +general case still affects you if you use ssh. + +General Case +------------ + +By default we use libcurl, which has its own ![recommendations for +thread safety](http://curl.haxx.se/libcurl/c/libcurl-tutorial.html#Multi-threading). + +If libcurl was not found or was disabled, libgit2 uses OpenSSL to be +able to use HTTPS as a transport. This library is made to be +thread-implementation agnostic, and the users of the library must set +which locking function it should use. This means that libgit2 cannot +know what to set as the user of libgit2 may use OpenSSL independently +and the locking settings must survive libgit2 shutting down. libgit2 does provide a last-resort convenience function `git_openssl_set_locking()` (available in `sys/openssl.h`) to use the @@ -71,8 +89,8 @@ [OpenSSL documentation](https://www.openssl.org/docs/crypto/threads.html) on threading for more details. -Be also aware that libgit2 may not always link against OpenSSL in the -future if there are alternatives provided by the system. +Be also aware that libgit2 does not always link against OpenSSL +if there are alternatives provided by the system. libssh2 may be linked against OpenSSL or libgcrypt. If it uses OpenSSL, you only need to set up threading for OpenSSL once and the diff -Nru libgit2-0.22.2/.travis.yml libgit2-0.23.1/.travis.yml --- libgit2-0.22.2/.travis.yml 2015-03-24 16:10:45.000000000 +0000 +++ libgit2-0.23.1/.travis.yml 2015-08-03 18:07:35.000000000 +0000 @@ -15,10 +15,22 @@ env: global: - secure: "YnhS+8n6B+uoyaYfaJ3Lei7cSJqHDPiKJCKFIF2c87YDfmCvAJke8QtE7IzjYDs7UFkTCM4ox+ph2bERUrxZbSCyEkHdjIZpKuMJfYWja/jgMqTMxdyOH9y8JLFbZsSXDIXDwqBlC6vVyl1fP90M35wuWcNTs6tctfVWVofEFbs=" + - GITTEST_INVASIVE_FS_SIZE=1 matrix: - OPTIONS="-DTHREADSAFE=ON -DCMAKE_BUILD_TYPE=Release" - OPTIONS="-DTHREADSAFE=OFF -DBUILD_EXAMPLES=ON" +addons: + apt: + packages: + - cmake + - libssh2-1-dev + - openssh-client + - openssh-server + - valgrind + +sudo: false + matrix: fast_finish: true exclude: @@ -26,7 +38,7 @@ compiler: gcc include: - compiler: i586-mingw32msvc-gcc - env: OPTIONS="-DBUILD_CLAR=OFF -DWIN32=ON -DMINGW=ON -DUSE_SSH=OFF" + env: OPTIONS="-DCMAKE_TOOLCHAIN_FILE=../script/toolchain-mingw32.cmake" SKIP_TESTS=1 os: linux - compiler: gcc env: COVERITY=1 @@ -43,7 +55,7 @@ OPTIONS="-DBUILD_CLAR=ON -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Debug" install: - - ./script/install-deps-${TRAVIS_OS_NAME}.sh + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then ./script/install-deps-${TRAVIS_OS_NAME}.sh; fi # Run the Build script and tests script: @@ -51,14 +63,13 @@ # Run Tests after_success: - - if [ "$TRAVIS_OS_NAME" = "linux" -a -n "$VALGRIND" ]; then sudo apt-get -qq install valgrind; fi - if [ "$TRAVIS_OS_NAME" = "linux" -a -n "$VALGRIND" ]; then valgrind --leak-check=full --show-reachable=yes --suppressions=./libgit2_clar.supp _build/libgit2_clar -ionline; fi # Only watch the development and master branches branches: only: - - development - master + - /^maint.*/ # Notify development list when needed notifications: