rugged 0.23.0 → 0.23.1
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_remote.c +1 -8
- data/ext/rugged/rugged_submodule_collection.c +3 -3
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +3 -1
- data/vendor/libgit2/include/git2/diff.h +19 -0
- data/vendor/libgit2/include/git2/errors.h +1 -12
- data/vendor/libgit2/include/git2/remote.h +9 -1
- data/vendor/libgit2/include/git2/repository.h +1 -1
- data/vendor/libgit2/include/git2/sys/config.h +1 -1
- data/vendor/libgit2/include/git2/sys/diff.h +4 -4
- data/vendor/libgit2/include/git2/sys/filter.h +4 -1
- data/vendor/libgit2/include/git2/sys/odb_backend.h +1 -1
- data/vendor/libgit2/include/git2/sys/refdb_backend.h +4 -3
- data/vendor/libgit2/include/git2/transport.h +14 -21
- data/vendor/libgit2/src/blame_git.c +10 -15
- data/vendor/libgit2/src/blob.c +6 -0
- data/vendor/libgit2/src/branch.c +1 -12
- data/vendor/libgit2/src/cache.c +4 -4
- data/vendor/libgit2/src/checkout.c +2 -2
- data/vendor/libgit2/src/clone.c +2 -2
- data/vendor/libgit2/src/common.h +13 -4
- data/vendor/libgit2/src/curl_stream.c +7 -7
- data/vendor/libgit2/src/describe.c +1 -1
- data/vendor/libgit2/src/diff.c +25 -0
- data/vendor/libgit2/src/errors.c +75 -40
- data/vendor/libgit2/src/filebuf.c +6 -1
- data/vendor/libgit2/src/filebuf.h +2 -0
- data/vendor/libgit2/src/filter.c +14 -9
- data/vendor/libgit2/src/global.c +25 -9
- data/vendor/libgit2/src/global.h +1 -0
- data/vendor/libgit2/src/index.c +75 -2
- data/vendor/libgit2/src/indexer.c +1 -1
- data/vendor/libgit2/src/iterator.c +6 -3
- data/vendor/libgit2/src/khash.h +1 -1
- data/vendor/libgit2/src/merge.c +3 -3
- data/vendor/libgit2/src/openssl_stream.c +5 -2
- data/vendor/libgit2/src/pack-objects.c +1 -1
- data/vendor/libgit2/src/pack.c +2 -2
- data/vendor/libgit2/src/path.c +25 -4
- data/vendor/libgit2/src/path.h +6 -1
- data/vendor/libgit2/src/push.h +3 -1
- data/vendor/libgit2/src/rebase.c +2 -2
- data/vendor/libgit2/src/refdb_fs.c +7 -0
- data/vendor/libgit2/src/remote.c +18 -9
- data/vendor/libgit2/src/revwalk.c +1 -1
- data/vendor/libgit2/src/stash.c +1 -1
- data/vendor/libgit2/src/stransport_stream.c +1 -1
- data/vendor/libgit2/src/submodule.c +12 -1
- data/vendor/libgit2/src/sysdir.c +22 -8
- data/vendor/libgit2/src/thread-utils.c +2 -0
- data/vendor/libgit2/src/transports/git.c +2 -0
- data/vendor/libgit2/src/transports/http.c +2 -2
- data/vendor/libgit2/src/transports/smart_pkt.c +1 -1
- data/vendor/libgit2/src/transports/ssh.c +4 -2
- data/vendor/libgit2/src/transports/winhttp.c +1 -1
- data/vendor/libgit2/src/util.c +48 -0
- data/vendor/libgit2/src/util.h +13 -5
- data/vendor/libgit2/src/win32/posix_w32.c +2 -0
- data/vendor/libgit2/src/win32/{buffer.c → w32_buffer.c} +1 -2
- data/vendor/libgit2/src/win32/{buffer.h → w32_buffer.h} +0 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +343 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +93 -0
- data/vendor/libgit2/src/win32/w32_stack.c +192 -0
- data/vendor/libgit2/src/win32/w32_stack.h +138 -0
- data/vendor/libgit2/src/xdiff/xdiff.h +10 -6
- data/vendor/libgit2/src/xdiff/xdiffi.c +46 -4
- data/vendor/libgit2/src/xdiff/xdiffi.h +1 -0
- data/vendor/libgit2/src/xdiff/xemit.c +43 -6
- data/vendor/libgit2/src/xdiff/xemit.h +1 -1
- data/vendor/libgit2/src/xdiff/xhistogram.c +1 -1
- data/vendor/libgit2/src/xdiff/xmerge.c +2 -2
- data/vendor/libgit2/src/xdiff/xpatience.c +1 -1
- data/vendor/libgit2/src/xdiff/xprepare.c +10 -11
- data/vendor/libgit2/src/xdiff/xutils.c +13 -29
- data/vendor/libgit2/src/xdiff/xutils.h +1 -0
- metadata +84 -80
@@ -0,0 +1,93 @@
|
|
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
|
@@ -0,0 +1,192 @@
|
|
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
|
@@ -0,0 +1,138 @@
|
|
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__ */
|
@@ -32,14 +32,14 @@ extern "C" {
|
|
32
32
|
#define XDF_IGNORE_WHITESPACE (1 << 2)
|
33
33
|
#define XDF_IGNORE_WHITESPACE_CHANGE (1 << 3)
|
34
34
|
#define XDF_IGNORE_WHITESPACE_AT_EOL (1 << 4)
|
35
|
+
#define XDF_WHITESPACE_FLAGS (XDF_IGNORE_WHITESPACE | XDF_IGNORE_WHITESPACE_CHANGE | XDF_IGNORE_WHITESPACE_AT_EOL)
|
36
|
+
|
35
37
|
#define XDF_PATIENCE_DIFF (1 << 5)
|
36
38
|
#define XDF_HISTOGRAM_DIFF (1 << 6)
|
37
|
-
#define
|
39
|
+
#define XDF_DIFF_ALGORITHM_MASK (XDF_PATIENCE_DIFF | XDF_HISTOGRAM_DIFF)
|
40
|
+
#define XDF_DIFF_ALG(x) ((x) & XDF_DIFF_ALGORITHM_MASK)
|
38
41
|
|
39
|
-
#define
|
40
|
-
#define XDL_PATCH_REVERSE '+'
|
41
|
-
#define XDL_PATCH_MODEMASK ((1 << 8) - 1)
|
42
|
-
#define XDL_PATCH_IGNOREBSPACE (1 << 8)
|
42
|
+
#define XDF_IGNORE_BLANK_LINES (1 << 7)
|
43
43
|
|
44
44
|
#define XDL_EMIT_FUNCNAMES (1 << 0)
|
45
45
|
#define XDL_EMIT_COMMON (1 << 1)
|
@@ -88,13 +88,17 @@ typedef struct s_xdemitcb {
|
|
88
88
|
|
89
89
|
typedef long (*find_func_t)(const char *line, long line_len, char *buffer, long buffer_size, void *priv);
|
90
90
|
|
91
|
+
typedef int (*xdl_emit_hunk_consume_func_t)(long start_a, long count_a,
|
92
|
+
long start_b, long count_b,
|
93
|
+
void *cb_data);
|
94
|
+
|
91
95
|
typedef struct s_xdemitconf {
|
92
96
|
long ctxlen;
|
93
97
|
long interhunkctxlen;
|
94
98
|
unsigned long flags;
|
95
99
|
find_func_t find_func;
|
96
100
|
void *find_func_priv;
|
97
|
-
|
101
|
+
xdl_emit_hunk_consume_func_t hunk_func;
|
98
102
|
} xdemitconf_t;
|
99
103
|
|
100
104
|
typedef struct s_bdiffparam {
|