rugged 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rugged/rugged_commit.c +1 -1
- data/lib/rugged/commit.rb +16 -2
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +31 -69
- data/vendor/libgit2/cmake/{Modules/AddCFlagIfSupported.cmake → AddCFlagIfSupported.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/EnableWarnings.cmake → EnableWarnings.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindCoreFoundation.cmake → FindCoreFoundation.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindGSSAPI.cmake → FindGSSAPI.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindGSSFramework.cmake → FindGSSFramework.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindHTTP_Parser.cmake → FindHTTP_Parser.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindIconv.cmake → FindIconv.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPCRE.cmake → FindPCRE.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPCRE2.cmake → FindPCRE2.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPkgLibraries.cmake → FindPkgLibraries.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindSecurity.cmake → FindSecurity.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindStatNsec.cmake → FindStatNsec.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindmbedTLS.cmake → FindmbedTLS.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/IdeSplitSources.cmake → IdeSplitSources.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/PkgBuildConfig.cmake → PkgBuildConfig.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/SanitizeBool.cmake → SanitizeBool.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/SelectGSSAPI.cmake → SelectGSSAPI.cmake} +18 -26
- data/vendor/libgit2/cmake/{Modules/SelectHTTPSBackend.cmake → SelectHTTPSBackend.cmake} +25 -32
- data/vendor/libgit2/cmake/{Modules/SelectHashes.cmake → SelectHashes.cmake} +20 -28
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +4 -3
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +6 -5
- data/vendor/libgit2/deps/ntlmclient/compat.h +8 -1
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +8 -11
- data/vendor/libgit2/deps/pcre/LICENCE +93 -0
- data/vendor/libgit2/deps/pcre/pcre.h +2 -2
- data/vendor/libgit2/deps/pcre/pcre_compile.c +29 -17
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +4 -4
- data/vendor/libgit2/deps/pcre/pcreposix.c +2 -3
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -5
- data/vendor/libgit2/deps/zlib/deflate.c +1 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +1 -1
- data/vendor/libgit2/include/git2/blame.h +2 -0
- data/vendor/libgit2/include/git2/common.h +15 -3
- data/vendor/libgit2/include/git2/deprecated.h +42 -2
- data/vendor/libgit2/include/git2/errors.h +2 -1
- data/vendor/libgit2/include/git2/index.h +1 -2
- data/vendor/libgit2/include/git2/pack.h +1 -1
- data/vendor/libgit2/include/git2/strarray.h +6 -10
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/src/CMakeLists.txt +53 -41
- data/vendor/libgit2/src/apply.c +5 -1
- data/vendor/libgit2/src/assert_safe.h +58 -0
- data/vendor/libgit2/src/attr_file.c +8 -3
- data/vendor/libgit2/src/attrcache.c +2 -3
- data/vendor/libgit2/src/blame.c +2 -0
- data/vendor/libgit2/src/blame_git.c +6 -3
- data/vendor/libgit2/src/blob.c +2 -0
- data/vendor/libgit2/src/branch.c +19 -21
- data/vendor/libgit2/src/buffer.c +6 -3
- data/vendor/libgit2/src/cache.c +1 -22
- data/vendor/libgit2/src/checkout.c +49 -72
- data/vendor/libgit2/src/cherrypick.c +2 -0
- data/vendor/libgit2/src/clone.c +78 -18
- data/vendor/libgit2/src/common.h +1 -0
- data/vendor/libgit2/src/config.c +3 -7
- data/vendor/libgit2/src/config_entries.c +35 -27
- data/vendor/libgit2/src/config_parse.c +1 -1
- data/vendor/libgit2/src/config_snapshot.c +2 -1
- data/vendor/libgit2/src/describe.c +5 -1
- data/vendor/libgit2/src/diff.c +12 -11
- data/vendor/libgit2/src/diff_file.c +3 -1
- data/vendor/libgit2/src/diff_generate.c +10 -11
- data/vendor/libgit2/src/diff_parse.c +2 -3
- data/vendor/libgit2/src/diff_print.c +63 -60
- data/vendor/libgit2/src/diff_stats.c +12 -11
- data/vendor/libgit2/src/diff_tform.c +2 -3
- data/vendor/libgit2/src/errors.c +2 -0
- data/vendor/libgit2/src/fetch.c +2 -0
- data/vendor/libgit2/src/filter.c +3 -3
- data/vendor/libgit2/src/futils.c +3 -3
- data/vendor/libgit2/src/futils.h +3 -3
- data/vendor/libgit2/src/global.c +3 -1
- data/vendor/libgit2/src/idxmap.c +0 -22
- data/vendor/libgit2/src/index.c +12 -7
- data/vendor/libgit2/src/indexer.c +10 -4
- data/vendor/libgit2/src/iterator.c +4 -4
- data/vendor/libgit2/src/merge.c +13 -7
- data/vendor/libgit2/src/merge_file.c +4 -6
- data/vendor/libgit2/src/midx.c +418 -0
- data/vendor/libgit2/src/midx.h +83 -0
- data/vendor/libgit2/src/mwindow.c +124 -51
- data/vendor/libgit2/src/net.c +6 -1
- data/vendor/libgit2/src/object.c +2 -1
- data/vendor/libgit2/src/odb.c +9 -6
- data/vendor/libgit2/src/odb_loose.c +3 -3
- data/vendor/libgit2/src/odb_mempack.c +2 -0
- data/vendor/libgit2/src/oid.c +2 -0
- data/vendor/libgit2/src/pack-objects.c +29 -21
- data/vendor/libgit2/src/pack.c +47 -28
- data/vendor/libgit2/src/pack.h +19 -2
- data/vendor/libgit2/src/patch_generate.c +1 -3
- data/vendor/libgit2/src/patch_parse.c +4 -2
- data/vendor/libgit2/src/path.c +4 -4
- data/vendor/libgit2/src/pathspec.c +4 -3
- data/vendor/libgit2/src/pool.c +21 -15
- data/vendor/libgit2/src/pool.h +9 -1
- data/vendor/libgit2/src/proxy.c +2 -0
- data/vendor/libgit2/src/push.c +2 -0
- data/vendor/libgit2/src/rebase.c +2 -0
- data/vendor/libgit2/src/refdb.c +135 -0
- data/vendor/libgit2/src/refdb.h +69 -0
- data/vendor/libgit2/src/refdb_fs.c +19 -81
- data/vendor/libgit2/src/reflog.c +2 -6
- data/vendor/libgit2/src/refs.c +60 -188
- data/vendor/libgit2/src/refs.h +1 -19
- data/vendor/libgit2/src/regexp.c +2 -2
- data/vendor/libgit2/src/remote.c +32 -17
- data/vendor/libgit2/src/repository.c +168 -79
- data/vendor/libgit2/src/repository.h +10 -27
- data/vendor/libgit2/src/revert.c +2 -0
- data/vendor/libgit2/src/revparse.c +5 -4
- data/vendor/libgit2/src/revwalk.c +3 -5
- data/vendor/libgit2/src/settings.c +9 -0
- data/vendor/libgit2/src/sortedcache.c +2 -3
- data/vendor/libgit2/src/stash.c +2 -0
- data/vendor/libgit2/src/status.c +2 -0
- data/vendor/libgit2/src/strarray.c +63 -0
- data/vendor/libgit2/src/streams/openssl.c +12 -6
- data/vendor/libgit2/src/streams/registry.c +5 -3
- data/vendor/libgit2/src/submodule.c +6 -4
- data/vendor/libgit2/src/sysdir.c +4 -20
- data/vendor/libgit2/src/sysdir.h +0 -11
- data/vendor/libgit2/src/tag.c +2 -0
- data/vendor/libgit2/src/thread-utils.h +139 -21
- data/vendor/libgit2/src/transaction.c +2 -1
- data/vendor/libgit2/src/transports/credential.c +2 -0
- data/vendor/libgit2/src/transports/credential_helpers.c +2 -0
- data/vendor/libgit2/src/transports/httpclient.c +6 -8
- data/vendor/libgit2/src/transports/local.c +2 -2
- data/vendor/libgit2/src/transports/smart.c +2 -2
- data/vendor/libgit2/src/transports/winhttp.c +18 -7
- data/vendor/libgit2/src/unix/posix.h +13 -1
- data/vendor/libgit2/src/util.c +25 -58
- data/vendor/libgit2/src/util.h +2 -2
- data/vendor/libgit2/src/win32/git2.rc +18 -3
- data/vendor/libgit2/src/win32/path_w32.c +2 -2
- data/vendor/libgit2/src/worktree.c +4 -0
- metadata +27 -25
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +0 -29
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +0 -96
- data/vendor/libgit2/src/refdb_fs.h +0 -19
@@ -47,6 +47,8 @@ typedef enum {
|
|
47
47
|
* to canonical real names and email addresses. The mailmap will be read
|
48
48
|
* from the working directory, or HEAD in a bare repository. */
|
49
49
|
GIT_BLAME_USE_MAILMAP = (1<<5),
|
50
|
+
/** Ignore whitespace differences */
|
51
|
+
GIT_BLAME_IGNORE_WHITESPACE = (1<<6),
|
50
52
|
} git_blame_flag_t;
|
51
53
|
|
52
54
|
/**
|
@@ -205,7 +205,9 @@ typedef enum {
|
|
205
205
|
GIT_OPT_GET_PACK_MAX_OBJECTS,
|
206
206
|
GIT_OPT_SET_PACK_MAX_OBJECTS,
|
207
207
|
GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS,
|
208
|
-
GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE
|
208
|
+
GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE,
|
209
|
+
GIT_OPT_GET_MWINDOW_FILE_LIMIT,
|
210
|
+
GIT_OPT_SET_MWINDOW_FILE_LIMIT
|
209
211
|
} git_libgit2_opt_t;
|
210
212
|
|
211
213
|
/**
|
@@ -227,8 +229,18 @@ typedef enum {
|
|
227
229
|
*
|
228
230
|
* * opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t):
|
229
231
|
*
|
230
|
-
* >Set the maximum amount of memory that can be mapped at any time
|
231
|
-
* by the library
|
232
|
+
* > Set the maximum amount of memory that can be mapped at any time
|
233
|
+
* > by the library
|
234
|
+
*
|
235
|
+
* * opts(GIT_OPT_GET_MWINDOW_FILE_LIMIT, size_t *):
|
236
|
+
*
|
237
|
+
* > Get the maximum number of files that will be mapped at any time by the
|
238
|
+
* > library
|
239
|
+
*
|
240
|
+
* * opts(GIT_OPT_SET_MWINDOW_FILE_LIMIT, size_t):
|
241
|
+
*
|
242
|
+
* > Set the maximum number of files that can be mapped at any time
|
243
|
+
* > by the library. The default (0) is unlimited.
|
232
244
|
*
|
233
245
|
* * opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)
|
234
246
|
*
|
@@ -102,7 +102,11 @@ GIT_EXTERN(int) git_blob_create_fromstream_commit(
|
|
102
102
|
GIT_EXTERN(int) git_blob_create_frombuffer(
|
103
103
|
git_oid *id, git_repository *repo, const void *buffer, size_t len);
|
104
104
|
|
105
|
-
/** Deprecated in favor of
|
105
|
+
/** Deprecated in favor of `git_blob_filter`.
|
106
|
+
*
|
107
|
+
* @deprecated Use git_blob_filter
|
108
|
+
* @see git_blob_filter
|
109
|
+
*/
|
106
110
|
GIT_EXTERN(int) git_blob_filtered_content(
|
107
111
|
git_buf *out,
|
108
112
|
git_blob *blob,
|
@@ -233,7 +237,7 @@ GIT_EXTERN(void) giterr_clear(void);
|
|
233
237
|
GIT_EXTERN(void) giterr_set_str(int error_class, const char *string);
|
234
238
|
|
235
239
|
/**
|
236
|
-
* Indicates that an out-of-memory situation
|
240
|
+
* Indicates that an out-of-memory situation occurred. This is an alias
|
237
241
|
* of `git_error_set_oom` and is preserved for backward compatibility.
|
238
242
|
*
|
239
243
|
* This function is deprecated, but there is no plan to remove this
|
@@ -524,6 +528,42 @@ typedef int GIT_CALLBACK(git_headlist_cb)(git_remote_head *rhead, void *payload)
|
|
524
528
|
|
525
529
|
/**@}*/
|
526
530
|
|
531
|
+
/** @name Deprecated String Array Functions
|
532
|
+
*
|
533
|
+
* These types are retained for backward compatibility. The newer
|
534
|
+
* versions of these values should be preferred in all new code.
|
535
|
+
*
|
536
|
+
* There is no plan to remove these backward compatibility values at
|
537
|
+
* this time.
|
538
|
+
*/
|
539
|
+
/**@{*/
|
540
|
+
|
541
|
+
/**
|
542
|
+
* Copy a string array object from source to target.
|
543
|
+
*
|
544
|
+
* This function is deprecated, but there is no plan to remove this
|
545
|
+
* function at this time.
|
546
|
+
*
|
547
|
+
* @param tgt target
|
548
|
+
* @param src source
|
549
|
+
* @return 0 on success, < 0 on allocation failure
|
550
|
+
*/
|
551
|
+
GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
|
552
|
+
|
553
|
+
/**
|
554
|
+
* Free the memory referred to by the git_strarray. This is an alias of
|
555
|
+
* `git_strarray_dispose` and is preserved for backward compatibility.
|
556
|
+
*
|
557
|
+
* This function is deprecated, but there is no plan to remove this
|
558
|
+
* function at this time.
|
559
|
+
*
|
560
|
+
* @deprecated Use git_strarray_dispose
|
561
|
+
* @see git_strarray_dispose
|
562
|
+
*/
|
563
|
+
GIT_EXTERN(void) git_strarray_free(git_strarray *array);
|
564
|
+
|
565
|
+
/**@}*/
|
566
|
+
|
527
567
|
/** @name Deprecated Options Initialization Functions
|
528
568
|
*
|
529
569
|
* These functions are retained for backward compatibility. The newer
|
@@ -555,8 +555,7 @@ GIT_EXTERN(int) git_index_add_bypath(git_index *index, const char *path);
|
|
555
555
|
*
|
556
556
|
* If a previous index entry exists that has the same path as the
|
557
557
|
* given 'entry', it will be replaced. Otherwise, the 'entry' will be
|
558
|
-
* added.
|
559
|
-
* real value of the blob.
|
558
|
+
* added.
|
560
559
|
*
|
561
560
|
* This forces the file to be added to the index, not looking
|
562
561
|
* at gitignore rules. Those rules can be evaluated through
|
@@ -155,7 +155,7 @@ GIT_EXTERN(int) git_packbuilder_write_buf(git_buf *buf, git_packbuilder *pb);
|
|
155
155
|
* Write the new pack and corresponding index file to path.
|
156
156
|
*
|
157
157
|
* @param pb The packbuilder
|
158
|
-
* @param path to the directory where the packfile and index should be stored
|
158
|
+
* @param path Path to the directory where the packfile and index should be stored, or NULL for default location
|
159
159
|
* @param mode permissions to use creating a packfile or 0 for defaults
|
160
160
|
* @param progress_cb function to call with progress information from the indexer (optional)
|
161
161
|
* @param progress_cb_payload payload for the progress callback (optional)
|
@@ -25,20 +25,16 @@ typedef struct git_strarray {
|
|
25
25
|
} git_strarray;
|
26
26
|
|
27
27
|
/**
|
28
|
-
*
|
29
|
-
*
|
30
|
-
*
|
31
|
-
* array is allocated and contains allocated strings, such as what you
|
32
|
-
* would get from `git_strarray_copy()`. Not doing so, will result in a
|
33
|
-
* memory leak.
|
28
|
+
* Free the strings contained in a string array. This method should
|
29
|
+
* be called on `git_strarray` objects that were provided by the
|
30
|
+
* library. Not doing so, will result in a memory leak.
|
34
31
|
*
|
35
32
|
* This does not free the `git_strarray` itself, since the library will
|
36
|
-
* never allocate that object directly itself
|
37
|
-
* inside another struct or created on the stack).
|
33
|
+
* never allocate that object directly itself.
|
38
34
|
*
|
39
|
-
* @param array git_strarray
|
35
|
+
* @param array The git_strarray that contains strings to free
|
40
36
|
*/
|
41
|
-
GIT_EXTERN(void)
|
37
|
+
GIT_EXTERN(void) git_strarray_dispose(git_strarray *array);
|
42
38
|
|
43
39
|
/**
|
44
40
|
* Copy a string array object from source to target.
|
@@ -7,12 +7,12 @@
|
|
7
7
|
#ifndef INCLUDE_git_version_h__
|
8
8
|
#define INCLUDE_git_version_h__
|
9
9
|
|
10
|
-
#define LIBGIT2_VERSION "1.0
|
10
|
+
#define LIBGIT2_VERSION "1.1.0"
|
11
11
|
#define LIBGIT2_VER_MAJOR 1
|
12
|
-
#define LIBGIT2_VER_MINOR
|
13
|
-
#define LIBGIT2_VER_REVISION
|
12
|
+
#define LIBGIT2_VER_MINOR 1
|
13
|
+
#define LIBGIT2_VER_REVISION 0
|
14
14
|
#define LIBGIT2_VER_PATCH 0
|
15
15
|
|
16
|
-
#define LIBGIT2_SOVERSION "1.
|
16
|
+
#define LIBGIT2_SOVERSION "1.1"
|
17
17
|
|
18
18
|
#endif
|
@@ -1,3 +1,6 @@
|
|
1
|
+
add_library(git2internal OBJECT)
|
2
|
+
set_target_properties(git2internal PROPERTIES C_STANDARD 90)
|
3
|
+
|
1
4
|
IF(DEBUG_POOL)
|
2
5
|
SET(GIT_DEBUG_POOL 1)
|
3
6
|
ENDIF()
|
@@ -21,6 +24,8 @@ SET(LIBGIT2_INCLUDES
|
|
21
24
|
SET(LIBGIT2_SYSTEM_INCLUDES "")
|
22
25
|
SET(LIBGIT2_LIBS "")
|
23
26
|
|
27
|
+
enable_warnings(missing-declarations)
|
28
|
+
|
24
29
|
# Enable tracing
|
25
30
|
IF(ENABLE_TRACE)
|
26
31
|
SET(GIT_TRACE 1)
|
@@ -36,19 +41,19 @@ CHECK_PROTOTYPE_DEFINITION(qsort_r
|
|
36
41
|
"void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *))"
|
37
42
|
"" "stdlib.h" HAVE_QSORT_R_BSD)
|
38
43
|
IF (HAVE_QSORT_R_BSD)
|
39
|
-
|
44
|
+
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_BSD)
|
40
45
|
ENDIF()
|
41
46
|
|
42
47
|
CHECK_PROTOTYPE_DEFINITION(qsort_r
|
43
48
|
"void qsort_r(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *, void *), void *arg)"
|
44
49
|
"" "stdlib.h" HAVE_QSORT_R_GNU)
|
45
50
|
IF (HAVE_QSORT_R_GNU)
|
46
|
-
|
51
|
+
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_R_GNU)
|
47
52
|
ENDIF()
|
48
53
|
|
49
54
|
CHECK_FUNCTION_EXISTS(qsort_s HAVE_QSORT_S)
|
50
55
|
IF (HAVE_QSORT_S)
|
51
|
-
|
56
|
+
target_compile_definitions(git2internal PRIVATE HAVE_QSORT_S)
|
52
57
|
ENDIF ()
|
53
58
|
|
54
59
|
# Find required dependencies
|
@@ -76,12 +81,15 @@ ENDIF()
|
|
76
81
|
ADD_FEATURE_INFO(threadsafe THREADSAFE "threadsafe support")
|
77
82
|
|
78
83
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
84
|
+
if(WIN32 AND EMBED_SSH_PATH)
|
85
|
+
file(GLOB SRC_SSH "${EMBED_SSH_PATH}/src/*.c")
|
86
|
+
list(SORT SRC_SSH)
|
87
|
+
target_sources(git2internal PRIVATE ${SRC_SSH})
|
88
|
+
|
89
|
+
list(APPEND LIBGIT2_SYSTEM_INCLUDES "${EMBED_SSH_PATH}/include")
|
90
|
+
file(WRITE "${EMBED_SSH_PATH}/src/libssh2_config.h" "#define HAVE_WINCNG\n#define LIBSSH2_WINCNG\n#include \"../win32/libssh2_config.h\"")
|
91
|
+
set(GIT_SSH 1)
|
92
|
+
endif()
|
85
93
|
|
86
94
|
IF (WIN32 AND WINHTTP)
|
87
95
|
SET(GIT_WINHTTP 1)
|
@@ -101,8 +109,9 @@ IF (WIN32 AND WINHTTP)
|
|
101
109
|
LIST(APPEND LIBGIT2_PC_LIBS "-lrpcrt4" "-lcrypt32" "-lole32")
|
102
110
|
ENDIF()
|
103
111
|
|
104
|
-
|
105
|
-
|
112
|
+
include(SelectHTTPSBackend)
|
113
|
+
include(SelectHashes)
|
114
|
+
target_sources(git2internal PRIVATE ${SRC_SHA1})
|
106
115
|
|
107
116
|
# Specify regular expression implementation
|
108
117
|
FIND_PACKAGE(PCRE)
|
@@ -264,36 +273,43 @@ ELSEIF (HAVE_STRUCT_STAT_ST_MTIME_NSEC)
|
|
264
273
|
SET(GIT_USE_STAT_MTIME_NSEC 1)
|
265
274
|
ENDIF()
|
266
275
|
|
267
|
-
|
276
|
+
target_compile_definitions(git2internal PRIVATE _FILE_OFFSET_BITS=64)
|
268
277
|
|
269
278
|
# Collect sourcefiles
|
270
|
-
|
279
|
+
file(GLOB SRC_H
|
271
280
|
"${libgit2_SOURCE_DIR}/include/git2.h"
|
272
281
|
"${libgit2_SOURCE_DIR}/include/git2/*.h"
|
273
282
|
"${libgit2_SOURCE_DIR}/include/git2/sys/*.h")
|
283
|
+
list(SORT SRC_H)
|
284
|
+
target_sources(git2internal PRIVATE ${SRC_H})
|
274
285
|
|
275
286
|
# On Windows use specific platform sources
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
+
if(WIN32 AND NOT CYGWIN)
|
288
|
+
SET(WIN_RC "win32/git2.rc")
|
289
|
+
|
290
|
+
file(GLOB SRC_OS win32/*.c win32/*.h)
|
291
|
+
list(SORT SRC_OS)
|
292
|
+
target_sources(git2internal PRIVATE ${SRC_OS})
|
293
|
+
elseif(AMIGA)
|
294
|
+
target_compile_definitions(git2internal PRIVATE NO_ADDRINFO NO_READDIR_R NO_MMAP)
|
295
|
+
else()
|
296
|
+
file(GLOB SRC_OS unix/*.c unix/*.h)
|
297
|
+
list(SORT SRC_OS)
|
298
|
+
target_sources(git2internal PRIVATE ${SRC_OS})
|
299
|
+
endif()
|
287
300
|
|
288
301
|
IF (USE_LEAK_CHECKER STREQUAL "valgrind")
|
289
|
-
|
302
|
+
target_compile_definitions(git2internal PRIVATE VALGRIND)
|
290
303
|
ENDIF()
|
291
304
|
|
292
|
-
|
305
|
+
file(GLOB SRC_GIT2 *.c *.h
|
293
306
|
allocators/*.c allocators/*.h
|
294
307
|
streams/*.c streams/*.h
|
295
308
|
transports/*.c transports/*.h
|
296
309
|
xdiff/*.c xdiff/*.h)
|
310
|
+
list(SORT SRC_GIT2)
|
311
|
+
target_sources(git2internal PRIVATE ${SRC_GIT2})
|
312
|
+
|
297
313
|
IF(APPLE)
|
298
314
|
# The old Secure Transport API has been deprecated in macOS 10.15.
|
299
315
|
SET_SOURCE_FILES_PROPERTIES(streams/stransport.c PROPERTIES COMPILE_FLAGS -Wno-deprecated)
|
@@ -319,10 +335,6 @@ ENDIF()
|
|
319
335
|
|
320
336
|
CONFIGURE_FILE(features.h.in git2/sys/features.h)
|
321
337
|
|
322
|
-
SET(LIBGIT2_SOURCES ${SRC_H} ${SRC_GIT2} ${SRC_OS} ${SRC_SSH} ${SRC_SHA1})
|
323
|
-
|
324
|
-
ADD_LIBRARY(git2internal OBJECT ${LIBGIT2_SOURCES})
|
325
|
-
SET_TARGET_PROPERTIES(git2internal PROPERTIES C_STANDARD 90)
|
326
338
|
IDE_SPLIT_SOURCES(git2internal)
|
327
339
|
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:git2internal>)
|
328
340
|
|
@@ -358,19 +370,19 @@ ENDIF()
|
|
358
370
|
|
359
371
|
IDE_SPLIT_SOURCES(git2)
|
360
372
|
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
373
|
+
if(SONAME)
|
374
|
+
set_target_properties(git2 PROPERTIES VERSION ${libgit2_VERSION})
|
375
|
+
set_target_properties(git2 PROPERTIES SOVERSION "${libgit2_VERSION_MAJOR}.${libgit2_VERSION_MINOR}")
|
376
|
+
if(LIBGIT2_FILENAME)
|
377
|
+
target_compile_definitions(git2internal PRIVATE LIBGIT2_FILENAME=\"${LIBGIT2_FILENAME}\")
|
378
|
+
set_target_properties(git2 PROPERTIES OUTPUT_NAME ${LIBGIT2_FILENAME})
|
379
|
+
elseif(DEFINED LIBGIT2_PREFIX)
|
380
|
+
set_target_properties(git2 PROPERTIES PREFIX "${LIBGIT2_PREFIX}")
|
381
|
+
endif()
|
382
|
+
endif()
|
371
383
|
|
372
384
|
PKG_BUILD_CONFIG(NAME libgit2
|
373
|
-
VERSION ${
|
385
|
+
VERSION ${libgit2_VERSION}
|
374
386
|
DESCRIPTION "The git library, take 2"
|
375
387
|
LIBS_SELF git2
|
376
388
|
PRIVATE_LIBS ${LIBGIT2_PC_LIBS}
|
data/vendor/libgit2/src/apply.c
CHANGED
@@ -63,7 +63,11 @@ static int patch_image_init_fromstr(
|
|
63
63
|
|
64
64
|
memset(out, 0x0, sizeof(patch_image));
|
65
65
|
|
66
|
-
git_pool_init(&out->pool, sizeof(git_diff_line))
|
66
|
+
if (git_pool_init(&out->pool, sizeof(git_diff_line)) < 0)
|
67
|
+
return -1;
|
68
|
+
|
69
|
+
if (!in_len)
|
70
|
+
return 0;
|
67
71
|
|
68
72
|
for (start = in; start < in + in_len; start = end) {
|
69
73
|
end = memchr(start, '\n', in_len - (start - in));
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) the libgit2 contributors. All rights reserved.
|
3
|
+
*
|
4
|
+
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
5
|
+
* a Linking Exception. For full terms see the included COPYING file.
|
6
|
+
*/
|
7
|
+
#ifndef INCLUDE_assert_safe_h__
|
8
|
+
#define INCLUDE_assert_safe_h__
|
9
|
+
|
10
|
+
/*
|
11
|
+
* In a debug build, we'll assert(3) for aide in debugging. In release
|
12
|
+
* builds, we will provide macros that will set an error message that
|
13
|
+
* indicate a failure and return. Note that memory leaks can occur in
|
14
|
+
* a release-mode assertion failure -- it is impractical to provide
|
15
|
+
* safe clean up routines in these very extreme failures, but care
|
16
|
+
* should be taken to not leak very large objects.
|
17
|
+
*/
|
18
|
+
|
19
|
+
#if (defined(_DEBUG) || defined(GIT_ASSERT_HARD)) && GIT_ASSERT_HARD != 0
|
20
|
+
# include <assert.h>
|
21
|
+
|
22
|
+
# define GIT_ASSERT(expr) assert(expr)
|
23
|
+
# define GIT_ASSERT_ARG(expr) assert(expr)
|
24
|
+
|
25
|
+
# define GIT_ASSERT_WITH_RETVAL(expr, fail) assert(expr)
|
26
|
+
# define GIT_ASSERT_ARG_WITH_RETVAL(expr, fail) assert(expr)
|
27
|
+
#else
|
28
|
+
|
29
|
+
/** Internal consistency check to stop the function. */
|
30
|
+
# define GIT_ASSERT(expr) GIT_ASSERT_WITH_RETVAL(expr, -1)
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Assert that a consumer-provided argument is valid, setting an
|
34
|
+
* actionable error message and returning -1 if it is not.
|
35
|
+
*/
|
36
|
+
# define GIT_ASSERT_ARG(expr) GIT_ASSERT_ARG_WITH_RETVAL(expr, -1)
|
37
|
+
|
38
|
+
/** Internal consistency check to return the `fail` param on failure. */
|
39
|
+
# define GIT_ASSERT_WITH_RETVAL(expr, fail) \
|
40
|
+
GIT_ASSERT__WITH_RETVAL(expr, GIT_ERROR_INTERNAL, "unrecoverable internal error", fail)
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Assert that a consumer-provided argument is valid, setting an
|
44
|
+
* actionable error message and returning the `fail` param if not.
|
45
|
+
*/
|
46
|
+
# define GIT_ASSERT_ARG_WITH_RETVAL(expr, fail) \
|
47
|
+
GIT_ASSERT__WITH_RETVAL(expr, GIT_ERROR_INVALID, "invalid argument", fail)
|
48
|
+
|
49
|
+
# define GIT_ASSERT__WITH_RETVAL(expr, code, msg, fail) do { \
|
50
|
+
if (!(expr)) { \
|
51
|
+
git_error_set(code, "%s: '%s'", msg, #expr); \
|
52
|
+
return fail; \
|
53
|
+
} \
|
54
|
+
} while(0)
|
55
|
+
|
56
|
+
#endif /* GIT_ASSERT_HARD */
|
57
|
+
|
58
|
+
#endif
|
@@ -41,16 +41,21 @@ int git_attr_file__new(
|
|
41
41
|
|
42
42
|
if (git_mutex_init(&attrs->lock) < 0) {
|
43
43
|
git_error_set(GIT_ERROR_OS, "failed to initialize lock");
|
44
|
-
|
45
|
-
return -1;
|
44
|
+
goto on_error;
|
46
45
|
}
|
47
46
|
|
48
|
-
git_pool_init(&attrs->pool, 1)
|
47
|
+
if (git_pool_init(&attrs->pool, 1) < 0)
|
48
|
+
goto on_error;
|
49
|
+
|
49
50
|
GIT_REFCOUNT_INC(attrs);
|
50
51
|
attrs->entry = entry;
|
51
52
|
attrs->source = source;
|
52
53
|
*out = attrs;
|
53
54
|
return 0;
|
55
|
+
|
56
|
+
on_error:
|
57
|
+
git__free(attrs);
|
58
|
+
return -1;
|
54
59
|
}
|
55
60
|
|
56
61
|
int git_attr_file__clear_rules(git_attr_file *file, bool need_lock)
|