rugged 0.27.5 → 0.27.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +2 -2
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +93 -0
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +2 -0
- data/vendor/libgit2/include/git2.h +1 -0
- data/vendor/libgit2/include/git2/attr.h +18 -7
- data/vendor/libgit2/include/git2/blame.h +39 -22
- data/vendor/libgit2/include/git2/blob.h +1 -1
- data/vendor/libgit2/include/git2/branch.h +1 -1
- data/vendor/libgit2/include/git2/buffer.h +14 -2
- data/vendor/libgit2/include/git2/checkout.h +13 -12
- data/vendor/libgit2/include/git2/cherrypick.h +6 -4
- data/vendor/libgit2/include/git2/clone.h +8 -6
- data/vendor/libgit2/include/git2/commit.h +28 -0
- data/vendor/libgit2/include/git2/common.h +27 -0
- data/vendor/libgit2/include/git2/config.h +1 -0
- data/vendor/libgit2/include/git2/describe.h +30 -7
- data/vendor/libgit2/include/git2/diff.h +32 -22
- data/vendor/libgit2/include/git2/errors.h +1 -0
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/mailmap.h +115 -0
- data/vendor/libgit2/include/git2/merge.h +10 -8
- data/vendor/libgit2/include/git2/proxy.h +9 -5
- data/vendor/libgit2/include/git2/rebase.h +7 -4
- data/vendor/libgit2/include/git2/refspec.h +17 -0
- data/vendor/libgit2/include/git2/remote.h +12 -10
- data/vendor/libgit2/include/git2/repository.h +7 -5
- data/vendor/libgit2/include/git2/revert.h +5 -3
- data/vendor/libgit2/include/git2/stash.h +11 -8
- data/vendor/libgit2/include/git2/status.h +7 -3
- data/vendor/libgit2/include/git2/submodule.h +8 -7
- data/vendor/libgit2/include/git2/sys/alloc.h +101 -0
- data/vendor/libgit2/include/git2/sys/index.h +3 -0
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +6 -1
- data/vendor/libgit2/include/git2/sys/path.h +55 -0
- data/vendor/libgit2/include/git2/transaction.h +1 -0
- data/vendor/libgit2/include/git2/types.h +8 -5
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/include/git2/worktree.h +46 -11
- data/vendor/libgit2/src/CMakeLists.txt +87 -15
- data/vendor/libgit2/src/alloc.c +47 -0
- data/vendor/libgit2/src/alloc.h +40 -0
- data/vendor/libgit2/src/apply.c +4 -4
- data/vendor/libgit2/src/attr.c +4 -4
- data/vendor/libgit2/src/attr_file.c +8 -7
- data/vendor/libgit2/src/attrcache.c +2 -2
- data/vendor/libgit2/src/blame.c +11 -4
- data/vendor/libgit2/src/blame.h +1 -0
- data/vendor/libgit2/src/blame_git.c +8 -5
- data/vendor/libgit2/src/blob.c +5 -5
- data/vendor/libgit2/src/branch.c +20 -20
- data/vendor/libgit2/src/buffer.c +9 -4
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/checkout.c +33 -24
- data/vendor/libgit2/src/cherrypick.c +3 -3
- data/vendor/libgit2/src/clone.c +13 -13
- data/vendor/libgit2/src/commit.c +16 -3
- data/vendor/libgit2/src/common.h +3 -1
- data/vendor/libgit2/src/config.c +3 -3
- data/vendor/libgit2/src/config_file.c +193 -241
- data/vendor/libgit2/src/config_parse.c +89 -66
- data/vendor/libgit2/src/config_parse.h +2 -2
- data/vendor/libgit2/src/crlf.c +9 -3
- data/vendor/libgit2/src/diff.c +2 -2
- data/vendor/libgit2/src/diff_driver.c +3 -3
- data/vendor/libgit2/src/diff_file.c +3 -3
- data/vendor/libgit2/src/diff_generate.c +4 -3
- data/vendor/libgit2/src/diff_print.c +8 -8
- data/vendor/libgit2/src/diff_tform.c +1 -1
- data/vendor/libgit2/src/diff_xdiff.c +12 -0
- data/vendor/libgit2/src/features.h.in +2 -0
- data/vendor/libgit2/src/fetch.c +2 -2
- data/vendor/libgit2/src/fetchhead.c +5 -5
- data/vendor/libgit2/src/filebuf.c +4 -4
- data/vendor/libgit2/src/fileops.c +10 -10
- data/vendor/libgit2/src/filter.c +3 -3
- data/vendor/libgit2/src/global.c +17 -12
- data/vendor/libgit2/src/hash.h +2 -0
- data/vendor/libgit2/src/hash/hash_mbedtls.c +38 -0
- data/vendor/libgit2/src/hash/hash_mbedtls.h +20 -0
- data/vendor/libgit2/src/ignore.c +15 -20
- data/vendor/libgit2/src/index.c +77 -36
- data/vendor/libgit2/src/index.h +10 -0
- data/vendor/libgit2/src/indexer.c +9 -9
- data/vendor/libgit2/src/iterator.c +8 -8
- data/vendor/libgit2/src/khash.h +3 -1
- data/vendor/libgit2/src/mailmap.c +485 -0
- data/vendor/libgit2/src/mailmap.h +35 -0
- data/vendor/libgit2/src/merge.c +7 -7
- data/vendor/libgit2/src/netops.c +5 -5
- data/vendor/libgit2/src/notes.c +2 -2
- data/vendor/libgit2/src/odb.c +7 -7
- data/vendor/libgit2/src/odb_loose.c +13 -13
- data/vendor/libgit2/src/odb_pack.c +3 -3
- data/vendor/libgit2/src/pack-objects.c +2 -2
- data/vendor/libgit2/src/pack.c +5 -5
- data/vendor/libgit2/src/pack.h +1 -1
- data/vendor/libgit2/src/patch.c +1 -1
- data/vendor/libgit2/src/patch_generate.c +2 -2
- data/vendor/libgit2/src/patch_parse.c +11 -4
- data/vendor/libgit2/src/path.c +42 -66
- data/vendor/libgit2/src/path.h +2 -72
- data/vendor/libgit2/src/pathspec.c +1 -1
- data/vendor/libgit2/src/push.c +2 -2
- data/vendor/libgit2/src/rebase.c +19 -22
- data/vendor/libgit2/src/refdb_fs.c +65 -34
- data/vendor/libgit2/src/refs.c +6 -6
- data/vendor/libgit2/src/refspec.c +30 -5
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +40 -40
- data/vendor/libgit2/src/repository.c +63 -59
- data/vendor/libgit2/src/reset.c +1 -1
- data/vendor/libgit2/src/revert.c +3 -3
- data/vendor/libgit2/src/revparse.c +4 -4
- data/vendor/libgit2/src/revwalk.c +44 -10
- data/vendor/libgit2/src/revwalk.h +2 -1
- data/vendor/libgit2/src/settings.c +25 -1
- data/vendor/libgit2/src/signature.c +1 -1
- data/vendor/libgit2/src/stash.c +80 -34
- data/vendor/libgit2/src/status.c +1 -1
- data/vendor/libgit2/src/stdalloc.c +120 -0
- data/vendor/libgit2/src/stdalloc.h +17 -0
- data/vendor/libgit2/src/streams/mbedtls.c +463 -0
- data/vendor/libgit2/src/streams/mbedtls.h +20 -0
- data/vendor/libgit2/src/streams/openssl.c +132 -34
- data/vendor/libgit2/src/streams/openssl.h +0 -107
- data/vendor/libgit2/src/streams/tls.c +3 -0
- data/vendor/libgit2/src/submodule.c +117 -82
- data/vendor/libgit2/src/sysdir.c +4 -4
- data/vendor/libgit2/src/tag.c +7 -7
- data/vendor/libgit2/src/trace.h +1 -1
- data/vendor/libgit2/src/trailer.c +6 -6
- data/vendor/libgit2/src/transport.c +2 -2
- data/vendor/libgit2/src/transports/auth.c +1 -1
- data/vendor/libgit2/src/transports/auth_negotiate.c +2 -2
- data/vendor/libgit2/src/transports/git.c +1 -1
- data/vendor/libgit2/src/transports/http.c +12 -12
- data/vendor/libgit2/src/transports/local.c +7 -7
- data/vendor/libgit2/src/transports/smart.c +17 -8
- data/vendor/libgit2/src/transports/smart.h +5 -5
- data/vendor/libgit2/src/transports/smart_pkt.c +122 -130
- data/vendor/libgit2/src/transports/smart_protocol.c +48 -38
- data/vendor/libgit2/src/transports/ssh.c +1 -1
- data/vendor/libgit2/src/transports/winhttp.c +6 -6
- data/vendor/libgit2/src/tree.c +12 -53
- data/vendor/libgit2/src/tree.h +0 -12
- data/vendor/libgit2/src/util.c +16 -0
- data/vendor/libgit2/src/util.h +12 -135
- data/vendor/libgit2/src/win32/findfile.c +2 -2
- data/vendor/libgit2/src/win32/posix_w32.c +1 -1
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.c +94 -0
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +28 -75
- data/vendor/libgit2/src/worktree.c +64 -43
- data/vendor/libgit2/src/worktree.h +2 -0
- data/vendor/libgit2/src/xdiff/xdiffi.c +3 -1
- metadata +16 -2
@@ -17,6 +17,34 @@
|
|
17
17
|
#include "git2/errors.h"
|
18
18
|
#include "strnlen.h"
|
19
19
|
|
20
|
+
/* MSVC CRTDBG memory leak reporting.
|
21
|
+
*
|
22
|
+
* We DO NOT use the "_CRTDBG_MAP_ALLOC" macro described in the MSVC
|
23
|
+
* documentation because all allocs/frees in libgit2 already go through
|
24
|
+
* the "git__" routines defined in this file. Simply using the normal
|
25
|
+
* reporting mechanism causes all leaks to be attributed to a routine
|
26
|
+
* here in util.h (ie, the actual call to calloc()) rather than the
|
27
|
+
* caller of git__calloc().
|
28
|
+
*
|
29
|
+
* Therefore, we declare a set of "git__crtdbg__" routines to replace
|
30
|
+
* the corresponding "git__" routines and re-define the "git__" symbols
|
31
|
+
* as macros. This allows us to get and report the file:line info of
|
32
|
+
* the real caller.
|
33
|
+
*
|
34
|
+
* We DO NOT replace the "git__free" routine because it needs to remain
|
35
|
+
* a function pointer because it is used as a function argument when
|
36
|
+
* setting up various structure "destructors".
|
37
|
+
*
|
38
|
+
* We also DO NOT use the "_CRTDBG_MAP_ALLOC" macro because it causes
|
39
|
+
* "free" to be remapped to "_free_dbg" and this causes problems for
|
40
|
+
* structures which define a field named "free".
|
41
|
+
*
|
42
|
+
* Finally, CRTDBG must be explicitly enabled and configured at program
|
43
|
+
* startup. See tests/main.c for an example.
|
44
|
+
*/
|
45
|
+
|
46
|
+
int git_win32_crtdbg_init_allocator(git_allocator *allocator);
|
47
|
+
|
20
48
|
/**
|
21
49
|
* Initialize our memory leak tracking and de-dup data structures.
|
22
50
|
* This should ONLY be called by git_libgit2_init().
|
@@ -97,80 +125,5 @@ GIT_EXTERN(int) git_win32__crtdbg_stacktrace__dump(
|
|
97
125
|
*/
|
98
126
|
const char *git_win32__crtdbg_stacktrace(int skip, const char *file);
|
99
127
|
|
100
|
-
GIT_INLINE(void *) git__crtdbg__malloc(size_t len, const char *file, int line)
|
101
|
-
{
|
102
|
-
void *ptr = _malloc_dbg(len, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line);
|
103
|
-
if (!ptr) giterr_set_oom();
|
104
|
-
return ptr;
|
105
|
-
}
|
106
|
-
|
107
|
-
GIT_INLINE(void *) git__crtdbg__calloc(size_t nelem, size_t elsize, const char *file, int line)
|
108
|
-
{
|
109
|
-
void *ptr = _calloc_dbg(nelem, elsize, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line);
|
110
|
-
if (!ptr) giterr_set_oom();
|
111
|
-
return ptr;
|
112
|
-
}
|
113
|
-
|
114
|
-
GIT_INLINE(char *) git__crtdbg__strdup(const char *str, const char *file, int line)
|
115
|
-
{
|
116
|
-
char *ptr = _strdup_dbg(str, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line);
|
117
|
-
if (!ptr) giterr_set_oom();
|
118
|
-
return ptr;
|
119
|
-
}
|
120
|
-
|
121
|
-
GIT_INLINE(char *) git__crtdbg__strndup(const char *str, size_t n, const char *file, int line)
|
122
|
-
{
|
123
|
-
size_t length = 0, alloclength;
|
124
|
-
char *ptr;
|
125
|
-
|
126
|
-
length = p_strnlen(str, n);
|
127
|
-
|
128
|
-
if (GIT_ADD_SIZET_OVERFLOW(&alloclength, length, 1) ||
|
129
|
-
!(ptr = git__crtdbg__malloc(alloclength, file, line)))
|
130
|
-
return NULL;
|
131
|
-
|
132
|
-
if (length)
|
133
|
-
memcpy(ptr, str, length);
|
134
|
-
|
135
|
-
ptr[length] = '\0';
|
136
|
-
|
137
|
-
return ptr;
|
138
|
-
}
|
139
|
-
|
140
|
-
GIT_INLINE(char *) git__crtdbg__substrdup(const char *start, size_t n, const char *file, int line)
|
141
|
-
{
|
142
|
-
char *ptr;
|
143
|
-
size_t alloclen;
|
144
|
-
|
145
|
-
if (GIT_ADD_SIZET_OVERFLOW(&alloclen, n, 1) ||
|
146
|
-
!(ptr = git__crtdbg__malloc(alloclen, file, line)))
|
147
|
-
return NULL;
|
148
|
-
|
149
|
-
memcpy(ptr, start, n);
|
150
|
-
ptr[n] = '\0';
|
151
|
-
return ptr;
|
152
|
-
}
|
153
|
-
|
154
|
-
GIT_INLINE(void *) git__crtdbg__realloc(void *ptr, size_t size, const char *file, int line)
|
155
|
-
{
|
156
|
-
void *new_ptr = _realloc_dbg(ptr, size, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line);
|
157
|
-
if (!new_ptr) giterr_set_oom();
|
158
|
-
return new_ptr;
|
159
|
-
}
|
160
|
-
|
161
|
-
GIT_INLINE(void *) git__crtdbg__reallocarray(void *ptr, size_t nelem, size_t elsize, const char *file, int line)
|
162
|
-
{
|
163
|
-
size_t newsize;
|
164
|
-
|
165
|
-
return GIT_MULTIPLY_SIZET_OVERFLOW(&newsize, nelem, elsize) ?
|
166
|
-
NULL : _realloc_dbg(ptr, newsize, _NORMAL_BLOCK, git_win32__crtdbg_stacktrace(1,file), line);
|
167
|
-
}
|
168
|
-
|
169
|
-
GIT_INLINE(void *) git__crtdbg__mallocarray(size_t nelem, size_t elsize, const char *file, int line)
|
170
|
-
{
|
171
|
-
return git__crtdbg__reallocarray(NULL, nelem, elsize, file, line);
|
172
|
-
}
|
173
|
-
|
174
|
-
|
175
128
|
#endif
|
176
129
|
#endif
|
@@ -25,7 +25,7 @@ static bool is_worktree_dir(const char *dir)
|
|
25
25
|
&& git_path_contains_file(&buf, "gitdir")
|
26
26
|
&& git_path_contains_file(&buf, "HEAD");
|
27
27
|
|
28
|
-
|
28
|
+
git_buf_dispose(&buf);
|
29
29
|
return error;
|
30
30
|
}
|
31
31
|
|
@@ -64,7 +64,7 @@ int git_worktree_list(git_strarray *wts, git_repository *repo)
|
|
64
64
|
wts->strings = (char **)git_vector_detach(&wts->count, NULL, &worktrees);
|
65
65
|
|
66
66
|
exit:
|
67
|
-
|
67
|
+
git_buf_dispose(&path);
|
68
68
|
|
69
69
|
return error;
|
70
70
|
}
|
@@ -79,7 +79,7 @@ char *git_worktree__read_link(const char *base, const char *file)
|
|
79
79
|
goto err;
|
80
80
|
if (git_futils_readbuffer(&buf, path.ptr) < 0)
|
81
81
|
goto err;
|
82
|
-
|
82
|
+
git_buf_dispose(&path);
|
83
83
|
|
84
84
|
git_buf_rtrim(&buf);
|
85
85
|
|
@@ -90,13 +90,13 @@ char *git_worktree__read_link(const char *base, const char *file)
|
|
90
90
|
goto err;
|
91
91
|
if (git_path_apply_relative(&path, buf.ptr) < 0)
|
92
92
|
goto err;
|
93
|
-
|
93
|
+
git_buf_dispose(&buf);
|
94
94
|
|
95
95
|
return git_buf_detach(&path);
|
96
96
|
|
97
97
|
err:
|
98
|
-
|
99
|
-
|
98
|
+
git_buf_dispose(&buf);
|
99
|
+
git_buf_dispose(&path);
|
100
100
|
|
101
101
|
return NULL;
|
102
102
|
}
|
@@ -115,7 +115,7 @@ static int write_wtfile(const char *base, const char *file, const git_buf *buf)
|
|
115
115
|
goto out;
|
116
116
|
|
117
117
|
out:
|
118
|
-
|
118
|
+
git_buf_dispose(&path);
|
119
119
|
|
120
120
|
return err;
|
121
121
|
}
|
@@ -139,7 +139,8 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char
|
|
139
139
|
if ((wt->name = git__strdup(name)) == NULL
|
140
140
|
|| (wt->commondir_path = git_worktree__read_link(dir, "commondir")) == NULL
|
141
141
|
|| (wt->gitlink_path = git_worktree__read_link(dir, "gitdir")) == NULL
|
142
|
-
|| (wt->parent_path = git__strdup(parent)) == NULL)
|
142
|
+
|| (parent && (wt->parent_path = git__strdup(parent)) == NULL)
|
143
|
+
|| (wt->worktree_path = git_path_dirname(wt->gitlink_path)) == NULL) {
|
143
144
|
error = -1;
|
144
145
|
goto out;
|
145
146
|
}
|
@@ -155,7 +156,7 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char
|
|
155
156
|
out:
|
156
157
|
if (error)
|
157
158
|
git_worktree_free(wt);
|
158
|
-
|
159
|
+
git_buf_dispose(&gitdir);
|
159
160
|
|
160
161
|
return error;
|
161
162
|
}
|
@@ -177,7 +178,7 @@ int git_worktree_lookup(git_worktree **out, git_repository *repo, const char *na
|
|
177
178
|
goto out;
|
178
179
|
|
179
180
|
out:
|
180
|
-
|
181
|
+
git_buf_dispose(&path);
|
181
182
|
|
182
183
|
if (error)
|
183
184
|
git_worktree_free(wt);
|
@@ -212,7 +213,7 @@ int git_worktree_open_from_repository(git_worktree **out, git_repository *repo)
|
|
212
213
|
|
213
214
|
out:
|
214
215
|
git__free(name);
|
215
|
-
|
216
|
+
git_buf_dispose(&parent);
|
216
217
|
|
217
218
|
return error;
|
218
219
|
}
|
@@ -223,6 +224,7 @@ void git_worktree_free(git_worktree *wt)
|
|
223
224
|
return;
|
224
225
|
|
225
226
|
git__free(wt->commondir_path);
|
227
|
+
git__free(wt->worktree_path);
|
226
228
|
git__free(wt->gitlink_path);
|
227
229
|
git__free(wt->gitdir_path);
|
228
230
|
git__free(wt->parent_path);
|
@@ -232,40 +234,30 @@ void git_worktree_free(git_worktree *wt)
|
|
232
234
|
|
233
235
|
int git_worktree_validate(const git_worktree *wt)
|
234
236
|
{
|
235
|
-
git_buf buf = GIT_BUF_INIT;
|
236
|
-
int err = 0;
|
237
|
-
|
238
237
|
assert(wt);
|
239
238
|
|
240
|
-
|
241
|
-
if (!is_worktree_dir(buf.ptr)) {
|
239
|
+
if (!is_worktree_dir(wt->gitdir_path)) {
|
242
240
|
giterr_set(GITERR_WORKTREE,
|
243
241
|
"Worktree gitdir ('%s') is not valid",
|
244
242
|
wt->gitlink_path);
|
245
|
-
|
246
|
-
goto out;
|
243
|
+
return GIT_ERROR;
|
247
244
|
}
|
248
245
|
|
249
|
-
if (!git_path_exists(wt->parent_path)) {
|
246
|
+
if (wt->parent_path && !git_path_exists(wt->parent_path)) {
|
250
247
|
giterr_set(GITERR_WORKTREE,
|
251
248
|
"Worktree parent directory ('%s') does not exist ",
|
252
249
|
wt->parent_path);
|
253
|
-
|
254
|
-
goto out;
|
250
|
+
return GIT_ERROR;
|
255
251
|
}
|
256
252
|
|
257
253
|
if (!git_path_exists(wt->commondir_path)) {
|
258
254
|
giterr_set(GITERR_WORKTREE,
|
259
255
|
"Worktree common directory ('%s') does not exist ",
|
260
256
|
wt->commondir_path);
|
261
|
-
|
262
|
-
goto out;
|
257
|
+
return GIT_ERROR;
|
263
258
|
}
|
264
259
|
|
265
|
-
|
266
|
-
git_buf_free(&buf);
|
267
|
-
|
268
|
-
return err;
|
260
|
+
return 0;
|
269
261
|
}
|
270
262
|
|
271
263
|
int git_worktree_add_init_options(git_worktree_add_options *opts,
|
@@ -348,13 +340,30 @@ int git_worktree_add(git_worktree **out, git_repository *repo,
|
|
348
340
|
|| (err = write_wtfile(gitdir.ptr, "gitdir", &buf)) < 0)
|
349
341
|
goto out;
|
350
342
|
|
351
|
-
/*
|
352
|
-
if (
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
343
|
+
/* Set up worktree reference */
|
344
|
+
if (wtopts.ref) {
|
345
|
+
if (!git_reference_is_branch(wtopts.ref)) {
|
346
|
+
giterr_set(GITERR_WORKTREE, "reference is not a branch");
|
347
|
+
err = -1;
|
348
|
+
goto out;
|
349
|
+
}
|
350
|
+
|
351
|
+
if (git_branch_is_checked_out(wtopts.ref)) {
|
352
|
+
giterr_set(GITERR_WORKTREE, "reference is already checked out");
|
353
|
+
err = -1;
|
354
|
+
goto out;
|
355
|
+
}
|
356
|
+
|
357
|
+
if ((err = git_reference_dup(&ref, wtopts.ref)) < 0)
|
358
|
+
goto out;
|
359
|
+
} else {
|
360
|
+
if ((err = git_repository_head(&head, repo)) < 0)
|
361
|
+
goto out;
|
362
|
+
if ((err = git_commit_lookup(&commit, repo, &head->target.oid)) < 0)
|
363
|
+
goto out;
|
364
|
+
if ((err = git_branch_create(&ref, repo, name, commit, false)) < 0)
|
365
|
+
goto out;
|
366
|
+
}
|
358
367
|
|
359
368
|
/* Set worktree's HEAD */
|
360
369
|
if ((err = git_repository_create_head(gitdir.ptr, git_reference_name(ref))) < 0)
|
@@ -372,9 +381,9 @@ int git_worktree_add(git_worktree **out, git_repository *repo,
|
|
372
381
|
goto out;
|
373
382
|
|
374
383
|
out:
|
375
|
-
|
376
|
-
|
377
|
-
|
384
|
+
git_buf_dispose(&gitdir);
|
385
|
+
git_buf_dispose(&wddir);
|
386
|
+
git_buf_dispose(&buf);
|
378
387
|
git_reference_free(ref);
|
379
388
|
git_reference_free(head);
|
380
389
|
git_commit_free(commit);
|
@@ -405,7 +414,7 @@ int git_worktree_lock(git_worktree *wt, const char *reason)
|
|
405
414
|
wt->locked = 1;
|
406
415
|
|
407
416
|
out:
|
408
|
-
|
417
|
+
git_buf_dispose(&path);
|
409
418
|
|
410
419
|
return err;
|
411
420
|
}
|
@@ -423,13 +432,13 @@ int git_worktree_unlock(git_worktree *wt)
|
|
423
432
|
return -1;
|
424
433
|
|
425
434
|
if (p_unlink(path.ptr) != 0) {
|
426
|
-
|
435
|
+
git_buf_dispose(&path);
|
427
436
|
return -1;
|
428
437
|
}
|
429
438
|
|
430
439
|
wt->locked = 0;
|
431
440
|
|
432
|
-
|
441
|
+
git_buf_dispose(&path);
|
433
442
|
|
434
443
|
return 0;
|
435
444
|
}
|
@@ -450,11 +459,23 @@ int git_worktree_is_locked(git_buf *reason, const git_worktree *wt)
|
|
450
459
|
git_futils_readbuffer(reason, path.ptr);
|
451
460
|
|
452
461
|
out:
|
453
|
-
|
462
|
+
git_buf_dispose(&path);
|
454
463
|
|
455
464
|
return ret;
|
456
465
|
}
|
457
466
|
|
467
|
+
const char *git_worktree_name(const git_worktree *wt)
|
468
|
+
{
|
469
|
+
assert(wt);
|
470
|
+
return wt->name;
|
471
|
+
}
|
472
|
+
|
473
|
+
const char *git_worktree_path(const git_worktree *wt)
|
474
|
+
{
|
475
|
+
assert(wt);
|
476
|
+
return wt->worktree_path;
|
477
|
+
}
|
478
|
+
|
458
479
|
int git_worktree_prune_init_options(
|
459
480
|
git_worktree_prune_options *opts,
|
460
481
|
unsigned int version)
|
@@ -483,7 +504,7 @@ int git_worktree_is_prunable(git_worktree *wt,
|
|
483
504
|
if (!reason.size)
|
484
505
|
git_buf_attach_notowned(&reason, "no reason given", 15);
|
485
506
|
giterr_set(GITERR_WORKTREE, "Not pruning locked working tree: '%s'", reason.ptr);
|
486
|
-
|
507
|
+
git_buf_dispose(&reason);
|
487
508
|
|
488
509
|
return 0;
|
489
510
|
}
|
@@ -551,7 +572,7 @@ int git_worktree_prune(git_worktree *wt,
|
|
551
572
|
goto out;
|
552
573
|
|
553
574
|
out:
|
554
|
-
|
575
|
+
git_buf_dispose(&path);
|
555
576
|
|
556
577
|
return err;
|
557
578
|
}
|
@@ -18,6 +18,8 @@ struct git_worktree {
|
|
18
18
|
* directory. */
|
19
19
|
char *name;
|
20
20
|
|
21
|
+
/* Path to the where the worktree lives in the filesystem */
|
22
|
+
char *worktree_path;
|
21
23
|
/* Path to the .git file in the working tree's repository */
|
22
24
|
char *gitlink_path;
|
23
25
|
/* Path to the .git directory inside the parent's
|
@@ -33,8 +33,10 @@
|
|
33
33
|
/** Declare a function as always inlined. */
|
34
34
|
#if defined(_MSC_VER)
|
35
35
|
# define XDL_INLINE(type) static __inline type
|
36
|
+
#elif defined(__GNUC__)
|
37
|
+
# define XDL_INLINE(type) static __inline__ type
|
36
38
|
#else
|
37
|
-
#
|
39
|
+
#define XDG_INLINE(type) static type
|
38
40
|
#endif
|
39
41
|
|
40
42
|
typedef struct s_xdpsplit {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rugged
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Chacon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-12-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- vendor/libgit2/cmake/Modules/FindPkgLibraries.cmake
|
132
132
|
- vendor/libgit2/cmake/Modules/FindSecurity.cmake
|
133
133
|
- vendor/libgit2/cmake/Modules/FindStatNsec.cmake
|
134
|
+
- vendor/libgit2/cmake/Modules/FindmbedTLS.cmake
|
134
135
|
- vendor/libgit2/cmake/Modules/IdeSplitSources.cmake
|
135
136
|
- vendor/libgit2/deps/http-parser/CMakeLists.txt
|
136
137
|
- vendor/libgit2/deps/http-parser/LICENSE-MIT
|
@@ -194,6 +195,7 @@ files:
|
|
194
195
|
- vendor/libgit2/include/git2/index.h
|
195
196
|
- vendor/libgit2/include/git2/indexer.h
|
196
197
|
- vendor/libgit2/include/git2/inttypes.h
|
198
|
+
- vendor/libgit2/include/git2/mailmap.h
|
197
199
|
- vendor/libgit2/include/git2/merge.h
|
198
200
|
- vendor/libgit2/include/git2/message.h
|
199
201
|
- vendor/libgit2/include/git2/net.h
|
@@ -224,6 +226,7 @@ files:
|
|
224
226
|
- vendor/libgit2/include/git2/stdint.h
|
225
227
|
- vendor/libgit2/include/git2/strarray.h
|
226
228
|
- vendor/libgit2/include/git2/submodule.h
|
229
|
+
- vendor/libgit2/include/git2/sys/alloc.h
|
227
230
|
- vendor/libgit2/include/git2/sys/commit.h
|
228
231
|
- vendor/libgit2/include/git2/sys/config.h
|
229
232
|
- vendor/libgit2/include/git2/sys/diff.h
|
@@ -234,6 +237,7 @@ files:
|
|
234
237
|
- vendor/libgit2/include/git2/sys/merge.h
|
235
238
|
- vendor/libgit2/include/git2/sys/odb_backend.h
|
236
239
|
- vendor/libgit2/include/git2/sys/openssl.h
|
240
|
+
- vendor/libgit2/include/git2/sys/path.h
|
237
241
|
- vendor/libgit2/include/git2/sys/refdb_backend.h
|
238
242
|
- vendor/libgit2/include/git2/sys/reflog.h
|
239
243
|
- vendor/libgit2/include/git2/sys/refs.h
|
@@ -251,6 +255,8 @@ files:
|
|
251
255
|
- vendor/libgit2/include/git2/worktree.h
|
252
256
|
- vendor/libgit2/libgit2.pc.in
|
253
257
|
- vendor/libgit2/src/CMakeLists.txt
|
258
|
+
- vendor/libgit2/src/alloc.c
|
259
|
+
- vendor/libgit2/src/alloc.h
|
254
260
|
- vendor/libgit2/src/annotated_commit.c
|
255
261
|
- vendor/libgit2/src/annotated_commit.h
|
256
262
|
- vendor/libgit2/src/apply.c
|
@@ -339,6 +345,8 @@ files:
|
|
339
345
|
- vendor/libgit2/src/hash/hash_common_crypto.h
|
340
346
|
- vendor/libgit2/src/hash/hash_generic.c
|
341
347
|
- vendor/libgit2/src/hash/hash_generic.h
|
348
|
+
- vendor/libgit2/src/hash/hash_mbedtls.c
|
349
|
+
- vendor/libgit2/src/hash/hash_mbedtls.h
|
342
350
|
- vendor/libgit2/src/hash/hash_openssl.h
|
343
351
|
- vendor/libgit2/src/hash/hash_win32.c
|
344
352
|
- vendor/libgit2/src/hash/hash_win32.h
|
@@ -360,6 +368,8 @@ files:
|
|
360
368
|
- vendor/libgit2/src/iterator.c
|
361
369
|
- vendor/libgit2/src/iterator.h
|
362
370
|
- vendor/libgit2/src/khash.h
|
371
|
+
- vendor/libgit2/src/mailmap.c
|
372
|
+
- vendor/libgit2/src/mailmap.h
|
363
373
|
- vendor/libgit2/src/map.h
|
364
374
|
- vendor/libgit2/src/merge.c
|
365
375
|
- vendor/libgit2/src/merge.h
|
@@ -447,9 +457,13 @@ files:
|
|
447
457
|
- vendor/libgit2/src/stash.c
|
448
458
|
- vendor/libgit2/src/status.c
|
449
459
|
- vendor/libgit2/src/status.h
|
460
|
+
- vendor/libgit2/src/stdalloc.c
|
461
|
+
- vendor/libgit2/src/stdalloc.h
|
450
462
|
- vendor/libgit2/src/stream.h
|
451
463
|
- vendor/libgit2/src/streams/curl.c
|
452
464
|
- vendor/libgit2/src/streams/curl.h
|
465
|
+
- vendor/libgit2/src/streams/mbedtls.c
|
466
|
+
- vendor/libgit2/src/streams/mbedtls.h
|
453
467
|
- vendor/libgit2/src/streams/openssl.c
|
454
468
|
- vendor/libgit2/src/streams/openssl.h
|
455
469
|
- vendor/libgit2/src/streams/socket.c
|