rugged 0.23.2 → 0.23.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rugged/version.rb +1 -1
  3. data/vendor/libgit2/CMakeLists.txt +12 -3
  4. data/vendor/libgit2/COPYING +46 -0
  5. data/vendor/libgit2/include/git2/config.h +4 -2
  6. data/vendor/libgit2/include/git2/cred_helpers.h +1 -1
  7. data/vendor/libgit2/include/git2/diff.h +0 -19
  8. data/vendor/libgit2/include/git2/errors.h +12 -0
  9. data/vendor/libgit2/include/git2/sys/filter.h +1 -4
  10. data/vendor/libgit2/include/git2/sys/refdb_backend.h +2 -3
  11. data/vendor/libgit2/include/git2/transport.h +21 -14
  12. data/vendor/libgit2/include/git2/version.h +2 -2
  13. data/vendor/libgit2/src/blame.c +1 -1
  14. data/vendor/libgit2/src/blame_git.c +27 -7
  15. data/vendor/libgit2/src/blame_git.h +1 -1
  16. data/vendor/libgit2/src/branch.c +12 -1
  17. data/vendor/libgit2/src/checkout.c +2 -1
  18. data/vendor/libgit2/src/clone.c +2 -2
  19. data/vendor/libgit2/src/common.h +13 -13
  20. data/vendor/libgit2/src/curl_stream.c +8 -7
  21. data/vendor/libgit2/src/diff.c +0 -25
  22. data/vendor/libgit2/src/diff_driver.c +6 -7
  23. data/vendor/libgit2/src/diff_patch.c +4 -0
  24. data/vendor/libgit2/src/diff_xdiff.c +7 -0
  25. data/vendor/libgit2/src/diff_xdiff.h +5 -0
  26. data/vendor/libgit2/src/errors.c +40 -75
  27. data/vendor/libgit2/src/filter.c +2 -5
  28. data/vendor/libgit2/src/global.c +9 -25
  29. data/vendor/libgit2/src/global.h +0 -1
  30. data/vendor/libgit2/src/index.c +3 -3
  31. data/vendor/libgit2/src/iterator.c +2 -2
  32. data/vendor/libgit2/src/merge.c +0 -56
  33. data/vendor/libgit2/src/merge_file.c +76 -22
  34. data/vendor/libgit2/src/openssl_stream.c +2 -3
  35. data/vendor/libgit2/src/path.c +0 -16
  36. data/vendor/libgit2/src/path.h +0 -5
  37. data/vendor/libgit2/src/refdb_fs.c +0 -7
  38. data/vendor/libgit2/src/remote.c +9 -18
  39. data/vendor/libgit2/src/stransport_stream.c +1 -1
  40. data/vendor/libgit2/src/submodule.c +7 -3
  41. data/vendor/libgit2/src/sysdir.c +8 -22
  42. data/vendor/libgit2/src/transports/http.c +9 -1
  43. data/vendor/libgit2/src/transports/smart_protocol.c +1 -1
  44. data/vendor/libgit2/src/transports/ssh.c +2 -2
  45. data/vendor/libgit2/src/transports/winhttp.c +1 -1
  46. data/vendor/libgit2/src/util.c +0 -48
  47. data/vendor/libgit2/src/util.h +5 -13
  48. data/vendor/libgit2/src/win32/posix_w32.c +0 -2
  49. data/vendor/libgit2/src/xdiff/xdiff.h +5 -3
  50. data/vendor/libgit2/src/xdiff/xdiffi.c +8 -4
  51. data/vendor/libgit2/src/xdiff/xhistogram.c +4 -2
  52. data/vendor/libgit2/src/xdiff/xmerge.c +98 -44
  53. metadata +76 -81
  54. data/vendor/libgit2/src/merge_file.h +0 -14
  55. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +0 -343
  56. data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +0 -93
  57. data/vendor/libgit2/src/win32/w32_stack.c +0 -192
  58. data/vendor/libgit2/src/win32/w32_stack.h +0 -138
@@ -1,93 +0,0 @@
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_w32_crtdbg_stacktrace_h__
8
- #define INCLUDE_w32_crtdbg_stacktrace_h__
9
-
10
- #if defined(GIT_MSVC_CRTDBG)
11
-
12
- /**
13
- * Initialize our memory leak tracking and de-dup data structures.
14
- * This should ONLY be called by git_libgit2_init().
15
- */
16
- void git_win32__crtdbg_stacktrace_init(void);
17
-
18
- /**
19
- * Shutdown our memory leak tracking and dump summary data.
20
- * This should ONLY be called by git_libgit2_shutdown().
21
- *
22
- * We explicitly call _CrtDumpMemoryLeaks() during here so
23
- * that we can compute summary data for the leaks. We print
24
- * the stacktrace of each unique leak.
25
- *
26
- * This cleanup does not happen if the app calls exit()
27
- * without calling the libgit2 shutdown code.
28
- *
29
- * This info we print here is independent of any automatic
30
- * reporting during exit() caused by _CRTDBG_LEAK_CHECK_DF.
31
- * Set it in your app if you also want traditional reporting.
32
- */
33
- void git_win32__crtdbg_stacktrace_cleanup(void);
34
-
35
- /**
36
- * Checkpoint options.
37
- */
38
- typedef enum git_win32__crtdbg_stacktrace_options {
39
- /**
40
- * Set checkpoint marker.
41
- */
42
- GIT_WIN32__CRTDBG_STACKTRACE__SET_MARK = (1 << 0),
43
-
44
- /**
45
- * Dump leaks since last checkpoint marker.
46
- * May not be combined with __LEAKS_TOTAL.
47
- *
48
- * Note that this may generate false positives for global TLS
49
- * error state and other global caches that aren't cleaned up
50
- * until the thread/process terminates. So when using this
51
- * around a region of interest, also check the final (at exit)
52
- * dump before digging into leaks reported here.
53
- */
54
- GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_SINCE_MARK = (1 << 1),
55
-
56
- /**
57
- * Dump leaks since init. May not be combined
58
- * with __LEAKS_SINCE_MARK.
59
- */
60
- GIT_WIN32__CRTDBG_STACKTRACE__LEAKS_TOTAL = (1 << 2),
61
-
62
- /**
63
- * Suppress printing during dumps.
64
- * Just return leak count.
65
- */
66
- GIT_WIN32__CRTDBG_STACKTRACE__QUIET = (1 << 3),
67
-
68
- } git_win32__crtdbg_stacktrace_options;
69
-
70
- /**
71
- * Checkpoint memory state and/or dump unique stack traces of
72
- * current memory leaks.
73
- *
74
- * @return number of unique leaks (relative to requested starting
75
- * point) or error.
76
- */
77
- GIT_EXTERN(int) git_win32__crtdbg_stacktrace__dump(
78
- git_win32__crtdbg_stacktrace_options opt,
79
- const char *label);
80
-
81
- /**
82
- * Construct stacktrace and append it to the global buffer.
83
- * Return pointer to start of this string. On any error or
84
- * lack of buffer space, just return the given file buffer
85
- * so it will behave as usual.
86
- *
87
- * This should ONLY be called by our internal memory allocations
88
- * routines.
89
- */
90
- const char *git_win32__crtdbg_stacktrace(int skip, const char *file);
91
-
92
- #endif
93
- #endif
@@ -1,192 +0,0 @@
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
-
8
- #if defined(GIT_MSVC_CRTDBG)
9
- #include "Windows.h"
10
- #include "Dbghelp.h"
11
- #include "win32/posix.h"
12
- #include "w32_stack.h"
13
- #include "hash.h"
14
-
15
- /**
16
- * This is supposedly defined in WinBase.h (from Windows.h) but there were linker issues.
17
- */
18
- USHORT WINAPI RtlCaptureStackBackTrace(ULONG, ULONG, PVOID*, PULONG);
19
-
20
- static bool g_win32_stack_initialized = false;
21
- static HANDLE g_win32_stack_process = INVALID_HANDLE_VALUE;
22
- static git_win32__stack__aux_cb_alloc g_aux_cb_alloc = NULL;
23
- static git_win32__stack__aux_cb_lookup g_aux_cb_lookup = NULL;
24
-
25
- int git_win32__stack__set_aux_cb(
26
- git_win32__stack__aux_cb_alloc cb_alloc,
27
- git_win32__stack__aux_cb_lookup cb_lookup)
28
- {
29
- g_aux_cb_alloc = cb_alloc;
30
- g_aux_cb_lookup = cb_lookup;
31
-
32
- return 0;
33
- }
34
-
35
- void git_win32__stack_init(void)
36
- {
37
- if (!g_win32_stack_initialized) {
38
- g_win32_stack_process = GetCurrentProcess();
39
- SymSetOptions(SYMOPT_LOAD_LINES);
40
- SymInitialize(g_win32_stack_process, NULL, TRUE);
41
- g_win32_stack_initialized = true;
42
- }
43
- }
44
-
45
- void git_win32__stack_cleanup(void)
46
- {
47
- if (g_win32_stack_initialized) {
48
- SymCleanup(g_win32_stack_process);
49
- g_win32_stack_process = INVALID_HANDLE_VALUE;
50
- g_win32_stack_initialized = false;
51
- }
52
- }
53
-
54
- int git_win32__stack_capture(git_win32__stack__raw_data *pdata, int skip)
55
- {
56
- if (!g_win32_stack_initialized) {
57
- giterr_set(GITERR_INVALID, "git_win32_stack not initialized.");
58
- return GIT_ERROR;
59
- }
60
-
61
- memset(pdata, 0, sizeof(*pdata));
62
- pdata->nr_frames = RtlCaptureStackBackTrace(
63
- skip+1, GIT_WIN32__STACK__MAX_FRAMES, pdata->frames, NULL);
64
-
65
- /* If an "aux" data provider was registered, ask it to capture
66
- * whatever data it needs and give us an "aux_id" to it so that
67
- * we can refer to it later when reporting.
68
- */
69
- if (g_aux_cb_alloc)
70
- (g_aux_cb_alloc)(&pdata->aux_id);
71
-
72
- return 0;
73
- }
74
-
75
- int git_win32__stack_compare(
76
- git_win32__stack__raw_data *d1,
77
- git_win32__stack__raw_data *d2)
78
- {
79
- return memcmp(d1, d2, sizeof(*d1));
80
- }
81
-
82
- int git_win32__stack_format(
83
- char *pbuf, int buf_len,
84
- const git_win32__stack__raw_data *pdata,
85
- const char *prefix, const char *suffix)
86
- {
87
- #define MY_MAX_FILENAME 255
88
-
89
- /* SYMBOL_INFO has char FileName[1] at the end. The docs say to
90
- * to malloc it with extra space for your desired max filename.
91
- */
92
- struct {
93
- SYMBOL_INFO symbol;
94
- char extra[MY_MAX_FILENAME + 1];
95
- } s;
96
-
97
- IMAGEHLP_LINE64 line;
98
- int buf_used = 0;
99
- unsigned int k;
100
- char detail[MY_MAX_FILENAME * 2]; /* filename plus space for function name and formatting */
101
- int detail_len;
102
-
103
- if (!g_win32_stack_initialized) {
104
- giterr_set(GITERR_INVALID, "git_win32_stack not initialized.");
105
- return GIT_ERROR;
106
- }
107
-
108
- if (!prefix)
109
- prefix = "\t";
110
- if (!suffix)
111
- suffix = "\n";
112
-
113
- memset(pbuf, 0, buf_len);
114
-
115
- memset(&s, 0, sizeof(s));
116
- s.symbol.MaxNameLen = MY_MAX_FILENAME;
117
- s.symbol.SizeOfStruct = sizeof(SYMBOL_INFO);
118
-
119
- memset(&line, 0, sizeof(line));
120
- line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
121
-
122
- for (k=0; k < pdata->nr_frames; k++) {
123
- DWORD64 frame_k = (DWORD64)pdata->frames[k];
124
- DWORD dwUnused;
125
-
126
- if (SymFromAddr(g_win32_stack_process, frame_k, 0, &s.symbol) &&
127
- SymGetLineFromAddr64(g_win32_stack_process, frame_k, &dwUnused, &line)) {
128
- const char *pslash;
129
- const char *pfile;
130
-
131
- pslash = strrchr(line.FileName, '\\');
132
- pfile = ((pslash) ? (pslash+1) : line.FileName);
133
- p_snprintf(detail, sizeof(detail), "%s%s:%d> %s%s",
134
- prefix, pfile, line.LineNumber, s.symbol.Name, suffix);
135
- } else {
136
- /* This happens when we cross into another module.
137
- * For example, in CLAR tests, this is typically
138
- * the CRT startup code. Just print an unknown
139
- * frame and continue.
140
- */
141
- p_snprintf(detail, sizeof(detail), "%s??%s", prefix, suffix);
142
- }
143
- detail_len = strlen(detail);
144
-
145
- if (buf_len < (buf_used + detail_len + 1)) {
146
- /* we don't have room for this frame in the buffer, so just stop. */
147
- break;
148
- }
149
-
150
- memcpy(&pbuf[buf_used], detail, detail_len);
151
- buf_used += detail_len;
152
- }
153
-
154
- /* "aux_id" 0 is reserved to mean no aux data. This is needed to handle
155
- * allocs that occur before the aux callbacks were registered.
156
- */
157
- if (pdata->aux_id > 0) {
158
- p_snprintf(detail, sizeof(detail), "%saux_id: %d%s",
159
- prefix, pdata->aux_id, suffix);
160
- detail_len = strlen(detail);
161
- if ((buf_used + detail_len + 1) < buf_len) {
162
- memcpy(&pbuf[buf_used], detail, detail_len);
163
- buf_used += detail_len;
164
- }
165
-
166
- /* If an "aux" data provider is still registered, ask it to append its detailed
167
- * data to the end of ours using the "aux_id" it gave us when this de-duped
168
- * item was created.
169
- */
170
- if (g_aux_cb_lookup)
171
- (g_aux_cb_lookup)(pdata->aux_id, &pbuf[buf_used], (buf_len - buf_used - 1));
172
- }
173
-
174
- return GIT_OK;
175
- }
176
-
177
- int git_win32__stack(
178
- char * pbuf, int buf_len,
179
- int skip,
180
- const char *prefix, const char *suffix)
181
- {
182
- git_win32__stack__raw_data data;
183
- int error;
184
-
185
- if ((error = git_win32__stack_capture(&data, skip)) < 0)
186
- return error;
187
- if ((error = git_win32__stack_format(pbuf, buf_len, &data, prefix, suffix)) < 0)
188
- return error;
189
- return 0;
190
- }
191
-
192
- #endif
@@ -1,138 +0,0 @@
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
-
8
- #ifndef INCLUDE_w32_stack_h__
9
- #define INCLUDE_w32_stack_h__
10
-
11
- #if defined(GIT_MSVC_CRTDBG)
12
-
13
- /**
14
- * This type defines a callback to be used to augment a C stacktrace
15
- * with "aux" data. This can be used, for example, to allow LibGit2Sharp
16
- * (or other interpreted consumer libraries) to give us C# stacktrace
17
- * data for the PInvoke.
18
- *
19
- * This callback will be called during crtdbg-instrumented allocs.
20
- *
21
- * @param aux_id [out] A returned "aux_id" representing a unique
22
- * (de-duped at the C# layer) stacktrace. "aux_id" 0 is reserved
23
- * to mean no aux stacktrace data.
24
- */
25
- typedef void (*git_win32__stack__aux_cb_alloc)(unsigned int *aux_id);
26
-
27
- /**
28
- * This type defines a callback to be used to augment the output of
29
- * a stacktrace. This will be used to request the C# layer format
30
- * the C# stacktrace associated with "aux_id" into the provided
31
- * buffer.
32
- *
33
- * This callback will be called during leak reporting.
34
- *
35
- * @param aux_id The "aux_id" key associated with a stacktrace.
36
- * @param aux_msg A buffer where a formatted message should be written.
37
- * @param aux_msg_len The size of the buffer.
38
- */
39
- typedef void (*git_win32__stack__aux_cb_lookup)(unsigned int aux_id, char *aux_msg, unsigned int aux_msg_len);
40
-
41
- /**
42
- * Register an "aux" data provider to augment our C stacktrace data.
43
- *
44
- * This can be used, for example, to allow LibGit2Sharp (or other
45
- * interpreted consumer libraries) to give us the C# stacktrace of
46
- * the PInvoke.
47
- *
48
- * If you choose to use this feature, it should be registered during
49
- * initialization and not changed for the duration of the process.
50
- */
51
- GIT_EXTERN(int) git_win32__stack__set_aux_cb(
52
- git_win32__stack__aux_cb_alloc cb_alloc,
53
- git_win32__stack__aux_cb_lookup cb_lookup);
54
-
55
- /**
56
- * Maximum number of stackframes to record for a
57
- * single stacktrace.
58
- */
59
- #define GIT_WIN32__STACK__MAX_FRAMES 30
60
-
61
- /**
62
- * Wrapper containing the raw unprocessed stackframe
63
- * data for a single stacktrace and any "aux_id".
64
- *
65
- * I put the aux_id first so leaks will be sorted by it.
66
- * So, for example, if a specific callstack in C# leaks
67
- * a repo handle, all of the pointers within the associated
68
- * repo pointer will be grouped together.
69
- */
70
- typedef struct {
71
- unsigned int aux_id;
72
- unsigned int nr_frames;
73
- void *frames[GIT_WIN32__STACK__MAX_FRAMES];
74
- } git_win32__stack__raw_data;
75
-
76
-
77
- /**
78
- * Load symbol table data. This should be done in the primary
79
- * thread at startup (under a lock if there are other threads
80
- * active).
81
- */
82
- void git_win32__stack_init(void);
83
-
84
- /**
85
- * Cleanup symbol table data. This should be done in the
86
- * primary thead at shutdown (under a lock if there are other
87
- * threads active).
88
- */
89
- void git_win32__stack_cleanup(void);
90
-
91
-
92
- /**
93
- * Capture raw stack trace data for the current process/thread.
94
- *
95
- * @param skip Number of initial frames to skip. Pass 0 to
96
- * begin with the caller of this routine. Pass 1 to begin
97
- * with its caller. And so on.
98
- */
99
- int git_win32__stack_capture(git_win32__stack__raw_data *pdata, int skip);
100
-
101
- /**
102
- * Compare 2 raw stacktraces with the usual -1,0,+1 result.
103
- * This includes any "aux_id" values in the comparison, so that
104
- * our de-dup is also "aux" context relative.
105
- */
106
- int git_win32__stack_compare(
107
- git_win32__stack__raw_data *d1,
108
- git_win32__stack__raw_data *d2);
109
-
110
- /**
111
- * Format raw stacktrace data into buffer WITHOUT using any mallocs.
112
- *
113
- * @param prefix String written before each frame; defaults to "\t".
114
- * @param suffix String written after each frame; defaults to "\n".
115
- */
116
- int git_win32__stack_format(
117
- char *pbuf, int buf_len,
118
- const git_win32__stack__raw_data *pdata,
119
- const char *prefix, const char *suffix);
120
-
121
- /**
122
- * Convenience routine to capture and format stacktrace into
123
- * a buffer WITHOUT using any mallocs. This is primarily a
124
- * wrapper for testing.
125
- *
126
- * @param skip Number of initial frames to skip. Pass 0 to
127
- * begin with the caller of this routine. Pass 1 to begin
128
- * with its caller. And so on.
129
- * @param prefix String written before each frame; defaults to "\t".
130
- * @param suffix String written after each frame; defaults to "\n".
131
- */
132
- int git_win32__stack(
133
- char * pbuf, int buf_len,
134
- int skip,
135
- const char *prefix, const char *suffix);
136
-
137
- #endif /* GIT_MSVC_CRTDBG */
138
- #endif /* INCLUDE_w32_stack_h__ */