rugged 0.27.7 → 0.27.9
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 +6 -2
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +29 -0
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +96 -0
- data/vendor/libgit2/cmake/Modules/FindIconv.cmake +11 -6
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +0 -2
- data/vendor/libgit2/include/git2.h +0 -1
- data/vendor/libgit2/include/git2/attr.h +7 -18
- data/vendor/libgit2/include/git2/blame.h +22 -39
- 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 +2 -14
- data/vendor/libgit2/include/git2/checkout.h +12 -13
- data/vendor/libgit2/include/git2/cherrypick.h +4 -6
- data/vendor/libgit2/include/git2/clone.h +6 -8
- data/vendor/libgit2/include/git2/commit.h +0 -28
- data/vendor/libgit2/include/git2/common.h +0 -27
- data/vendor/libgit2/include/git2/config.h +0 -1
- data/vendor/libgit2/include/git2/describe.h +7 -30
- data/vendor/libgit2/include/git2/diff.h +22 -32
- data/vendor/libgit2/include/git2/errors.h +0 -1
- data/vendor/libgit2/include/git2/ignore.h +2 -2
- data/vendor/libgit2/include/git2/merge.h +8 -10
- data/vendor/libgit2/include/git2/proxy.h +5 -9
- data/vendor/libgit2/include/git2/rebase.h +4 -7
- data/vendor/libgit2/include/git2/refs.h +1 -1
- data/vendor/libgit2/include/git2/refspec.h +0 -17
- data/vendor/libgit2/include/git2/remote.h +10 -12
- data/vendor/libgit2/include/git2/repository.h +5 -7
- data/vendor/libgit2/include/git2/revert.h +3 -5
- data/vendor/libgit2/include/git2/stash.h +8 -11
- data/vendor/libgit2/include/git2/status.h +3 -7
- data/vendor/libgit2/include/git2/submodule.h +7 -8
- data/vendor/libgit2/include/git2/sys/index.h +0 -3
- data/vendor/libgit2/include/git2/sys/mempack.h +35 -35
- data/vendor/libgit2/include/git2/sys/merge.h +1 -6
- data/vendor/libgit2/include/git2/transaction.h +0 -1
- data/vendor/libgit2/include/git2/types.h +5 -8
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/include/git2/worktree.h +11 -46
- data/vendor/libgit2/src/CMakeLists.txt +28 -91
- data/vendor/libgit2/src/annotated_commit.c +4 -4
- data/vendor/libgit2/src/apply.c +6 -5
- data/vendor/libgit2/src/attr.c +4 -4
- data/vendor/libgit2/src/attr_file.c +5 -5
- data/vendor/libgit2/src/attrcache.c +2 -2
- data/vendor/libgit2/src/blame.c +4 -11
- data/vendor/libgit2/src/blame.h +0 -1
- data/vendor/libgit2/src/blame_git.c +5 -8
- data/vendor/libgit2/src/blob.c +5 -5
- data/vendor/libgit2/src/branch.c +20 -20
- data/vendor/libgit2/src/buffer.c +4 -9
- data/vendor/libgit2/src/buffer.h +1 -1
- data/vendor/libgit2/src/checkout.c +24 -33
- data/vendor/libgit2/src/cherrypick.c +3 -3
- data/vendor/libgit2/src/clone.c +13 -13
- data/vendor/libgit2/src/commit.c +5 -18
- data/vendor/libgit2/src/commit_list.c +9 -3
- data/vendor/libgit2/src/common.h +1 -3
- data/vendor/libgit2/src/config.c +15 -6
- data/vendor/libgit2/src/config_file.c +249 -193
- data/vendor/libgit2/src/config_parse.c +66 -89
- data/vendor/libgit2/src/config_parse.h +2 -2
- data/vendor/libgit2/src/crlf.c +3 -9
- 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 +3 -4
- data/vendor/libgit2/src/diff_print.c +8 -8
- data/vendor/libgit2/src/diff_tform.c +4 -2
- data/vendor/libgit2/src/diff_xdiff.c +0 -12
- data/vendor/libgit2/src/features.h.in +0 -2
- 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 +9 -3
- data/vendor/libgit2/src/global.c +12 -17
- data/vendor/libgit2/src/hash.h +0 -2
- data/vendor/libgit2/src/ignore.c +5 -5
- data/vendor/libgit2/src/index.c +40 -80
- data/vendor/libgit2/src/index.h +0 -10
- data/vendor/libgit2/src/indexer.c +9 -9
- data/vendor/libgit2/src/iterator.c +8 -8
- data/vendor/libgit2/src/khash.h +1 -3
- 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 +9 -9
- data/vendor/libgit2/src/odb_loose.c +22 -18
- data/vendor/libgit2/src/odb_pack.c +3 -3
- data/vendor/libgit2/src/pack-objects.c +3 -3
- data/vendor/libgit2/src/pack.c +5 -5
- data/vendor/libgit2/src/pack.h +1 -1
- data/vendor/libgit2/src/parse.c +7 -4
- data/vendor/libgit2/src/patch.c +1 -1
- data/vendor/libgit2/src/patch_generate.c +2 -2
- data/vendor/libgit2/src/patch_parse.c +4 -24
- data/vendor/libgit2/src/path.c +140 -39
- data/vendor/libgit2/src/path.h +84 -2
- data/vendor/libgit2/src/pathspec.c +1 -1
- data/vendor/libgit2/src/push.c +2 -2
- data/vendor/libgit2/src/rebase.c +23 -20
- data/vendor/libgit2/src/refdb_fs.c +34 -65
- data/vendor/libgit2/src/refs.c +16 -13
- data/vendor/libgit2/src/refspec.c +5 -30
- data/vendor/libgit2/src/refspec.h +1 -1
- data/vendor/libgit2/src/remote.c +43 -43
- data/vendor/libgit2/src/repository.c +56 -56
- data/vendor/libgit2/src/reset.c +1 -1
- data/vendor/libgit2/src/revert.c +3 -3
- data/vendor/libgit2/src/revparse.c +7 -6
- data/vendor/libgit2/src/revwalk.c +20 -48
- data/vendor/libgit2/src/revwalk.h +1 -2
- data/vendor/libgit2/src/settings.c +1 -25
- data/vendor/libgit2/src/signature.c +4 -2
- data/vendor/libgit2/src/stash.c +34 -80
- data/vendor/libgit2/src/status.c +1 -1
- data/vendor/libgit2/src/streams/curl.c +1 -1
- data/vendor/libgit2/src/streams/openssl.c +34 -132
- data/vendor/libgit2/src/streams/openssl.h +107 -0
- data/vendor/libgit2/src/streams/tls.c +0 -3
- data/vendor/libgit2/src/submodule.c +83 -118
- data/vendor/libgit2/src/sysdir.c +4 -4
- data/vendor/libgit2/src/tag.c +12 -12
- 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 +15 -12
- data/vendor/libgit2/src/transports/local.c +7 -7
- data/vendor/libgit2/src/transports/smart.c +15 -20
- data/vendor/libgit2/src/transports/smart.h +5 -5
- data/vendor/libgit2/src/transports/smart_pkt.c +131 -123
- data/vendor/libgit2/src/transports/smart_protocol.c +38 -48
- data/vendor/libgit2/src/transports/ssh.c +1 -1
- data/vendor/libgit2/src/transports/winhttp.c +26 -21
- data/vendor/libgit2/src/tree-cache.c +2 -2
- data/vendor/libgit2/src/tree.c +69 -23
- data/vendor/libgit2/src/tree.h +12 -0
- data/vendor/libgit2/src/util.c +99 -52
- data/vendor/libgit2/src/util.h +138 -14
- data/vendor/libgit2/src/vector.c +13 -8
- 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 +0 -94
- data/vendor/libgit2/src/win32/w32_crtdbg_stacktrace.h +75 -28
- data/vendor/libgit2/src/worktree.c +44 -65
- data/vendor/libgit2/src/worktree.h +0 -2
- data/vendor/libgit2/src/xdiff/xdiffi.c +1 -3
- metadata +5 -17
- data/vendor/libgit2/cmake/Modules/FindmbedTLS.cmake +0 -93
- data/vendor/libgit2/include/git2/mailmap.h +0 -115
- data/vendor/libgit2/include/git2/sys/alloc.h +0 -101
- data/vendor/libgit2/include/git2/sys/path.h +0 -55
- data/vendor/libgit2/src/alloc.c +0 -47
- data/vendor/libgit2/src/alloc.h +0 -40
- data/vendor/libgit2/src/hash/hash_mbedtls.c +0 -38
- data/vendor/libgit2/src/hash/hash_mbedtls.h +0 -20
- data/vendor/libgit2/src/mailmap.c +0 -485
- data/vendor/libgit2/src/mailmap.h +0 -35
- data/vendor/libgit2/src/stdalloc.c +0 -120
- data/vendor/libgit2/src/stdalloc.h +0 -17
- data/vendor/libgit2/src/streams/mbedtls.c +0 -463
- data/vendor/libgit2/src/streams/mbedtls.h +0 -20
data/vendor/libgit2/src/refs.c
CHANGED
@@ -282,7 +282,7 @@ int git_reference__read_head(
|
|
282
282
|
|
283
283
|
out:
|
284
284
|
git__free(name);
|
285
|
-
|
285
|
+
git_buf_free(&reference);
|
286
286
|
|
287
287
|
return error;
|
288
288
|
}
|
@@ -346,8 +346,8 @@ cleanup:
|
|
346
346
|
if (error == GIT_ENOTFOUND)
|
347
347
|
giterr_set(GITERR_REFERENCE, "no reference found for shorthand '%s'", refname);
|
348
348
|
|
349
|
-
|
350
|
-
|
349
|
+
git_buf_free(&name);
|
350
|
+
git_buf_free(&refnamebuf);
|
351
351
|
return error;
|
352
352
|
}
|
353
353
|
|
@@ -709,6 +709,8 @@ int git_reference_rename(
|
|
709
709
|
git_signature *who;
|
710
710
|
int error;
|
711
711
|
|
712
|
+
assert(out && ref);
|
713
|
+
|
712
714
|
if ((error = git_reference__log_signature(&who, ref->db->repo)) < 0)
|
713
715
|
return error;
|
714
716
|
|
@@ -1076,7 +1078,7 @@ cleanup:
|
|
1076
1078
|
"the given reference name '%s' is not valid", name);
|
1077
1079
|
|
1078
1080
|
if (error && normalize)
|
1079
|
-
|
1081
|
+
git_buf_free(buf);
|
1080
1082
|
|
1081
1083
|
#ifdef GIT_USE_ICONV
|
1082
1084
|
git_path_iconv_clear(&ic);
|
@@ -1110,7 +1112,7 @@ int git_reference_normalize_name(
|
|
1110
1112
|
error = 0;
|
1111
1113
|
|
1112
1114
|
cleanup:
|
1113
|
-
|
1115
|
+
git_buf_free(&buf);
|
1114
1116
|
return error;
|
1115
1117
|
}
|
1116
1118
|
|
@@ -1262,7 +1264,7 @@ int git_reference__update_for_commit(
|
|
1262
1264
|
|
1263
1265
|
done:
|
1264
1266
|
git_reference_free(ref_new);
|
1265
|
-
|
1267
|
+
git_buf_free(&reflog_msg);
|
1266
1268
|
git_commit_free(commit);
|
1267
1269
|
return error;
|
1268
1270
|
}
|
@@ -1337,7 +1339,7 @@ int git_reference_is_note(const git_reference *ref)
|
|
1337
1339
|
return git_reference__is_note(ref->name);
|
1338
1340
|
}
|
1339
1341
|
|
1340
|
-
static int peel_error(int error, git_reference *ref, const char* msg)
|
1342
|
+
static int peel_error(int error, const git_reference *ref, const char* msg)
|
1341
1343
|
{
|
1342
1344
|
giterr_set(
|
1343
1345
|
GITERR_INVALID,
|
@@ -1347,10 +1349,11 @@ static int peel_error(int error, git_reference *ref, const char* msg)
|
|
1347
1349
|
|
1348
1350
|
int git_reference_peel(
|
1349
1351
|
git_object **peeled,
|
1350
|
-
git_reference *ref,
|
1352
|
+
const git_reference *ref,
|
1351
1353
|
git_otype target_type)
|
1352
1354
|
{
|
1353
|
-
git_reference *resolved = NULL;
|
1355
|
+
const git_reference *resolved = NULL;
|
1356
|
+
git_reference *allocated = NULL;
|
1354
1357
|
git_object *target = NULL;
|
1355
1358
|
int error;
|
1356
1359
|
|
@@ -1359,8 +1362,10 @@ int git_reference_peel(
|
|
1359
1362
|
if (ref->type == GIT_REF_OID) {
|
1360
1363
|
resolved = ref;
|
1361
1364
|
} else {
|
1362
|
-
if ((error = git_reference_resolve(&
|
1365
|
+
if ((error = git_reference_resolve(&allocated, ref)) < 0)
|
1363
1366
|
return peel_error(error, ref, "Cannot resolve reference");
|
1367
|
+
|
1368
|
+
resolved = allocated;
|
1364
1369
|
}
|
1365
1370
|
|
1366
1371
|
/*
|
@@ -1389,9 +1394,7 @@ int git_reference_peel(
|
|
1389
1394
|
|
1390
1395
|
cleanup:
|
1391
1396
|
git_object_free(target);
|
1392
|
-
|
1393
|
-
if (resolved != ref)
|
1394
|
-
git_reference_free(resolved);
|
1397
|
+
git_reference_free(allocated);
|
1395
1398
|
|
1396
1399
|
return error;
|
1397
1400
|
}
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
|
18
18
|
{
|
19
|
-
|
19
|
+
// Ported from https://github.com/git/git/blob/f06d47e7e0d9db709ee204ed13a8a7486149f494/remote.c#L518-636
|
20
20
|
|
21
21
|
size_t llen;
|
22
22
|
int is_glob = 0;
|
@@ -144,11 +144,11 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
|
|
144
144
|
giterr_set(
|
145
145
|
GITERR_INVALID,
|
146
146
|
"'%s' is not a valid refspec.", input);
|
147
|
-
|
147
|
+
git_refspec__free(refspec);
|
148
148
|
return -1;
|
149
149
|
}
|
150
150
|
|
151
|
-
void
|
151
|
+
void git_refspec__free(git_refspec *refspec)
|
152
152
|
{
|
153
153
|
if (refspec == NULL)
|
154
154
|
return;
|
@@ -160,31 +160,6 @@ void git_refspec__dispose(git_refspec *refspec)
|
|
160
160
|
memset(refspec, 0x0, sizeof(git_refspec));
|
161
161
|
}
|
162
162
|
|
163
|
-
int git_refspec_parse(git_refspec **out_refspec, const char *input, int is_fetch)
|
164
|
-
{
|
165
|
-
git_refspec *refspec;
|
166
|
-
assert(out_refspec && input);
|
167
|
-
|
168
|
-
*out_refspec = NULL;
|
169
|
-
|
170
|
-
refspec = git__malloc(sizeof(git_refspec));
|
171
|
-
GITERR_CHECK_ALLOC(refspec);
|
172
|
-
|
173
|
-
if (git_refspec__parse(refspec, input, !!is_fetch) != 0) {
|
174
|
-
git__free(refspec);
|
175
|
-
return -1;
|
176
|
-
}
|
177
|
-
|
178
|
-
*out_refspec = refspec;
|
179
|
-
return 0;
|
180
|
-
}
|
181
|
-
|
182
|
-
void git_refspec_free(git_refspec *refspec)
|
183
|
-
{
|
184
|
-
git_refspec__dispose(refspec);
|
185
|
-
git__free(refspec);
|
186
|
-
}
|
187
|
-
|
188
163
|
const char *git_refspec_src(const git_refspec *refspec)
|
189
164
|
{
|
190
165
|
return refspec == NULL ? NULL : refspec->src;
|
@@ -277,7 +252,7 @@ int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *nam
|
|
277
252
|
}
|
278
253
|
|
279
254
|
if (!spec->pattern)
|
280
|
-
return git_buf_puts(out, spec->dst
|
255
|
+
return git_buf_puts(out, spec->dst);
|
281
256
|
|
282
257
|
return refspec_transform(out, spec->src, spec->dst, name);
|
283
258
|
}
|
@@ -384,7 +359,7 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs)
|
|
384
359
|
cur->dst = git_buf_detach(&buf);
|
385
360
|
}
|
386
361
|
|
387
|
-
|
362
|
+
git_buf_free(&buf);
|
388
363
|
|
389
364
|
if (cur->dst == NULL && spec->dst != NULL) {
|
390
365
|
cur->dst = git__strdup(spec->dst);
|
data/vendor/libgit2/src/remote.c
CHANGED
@@ -44,7 +44,7 @@ static int add_refspec_to(git_vector *vector, const char *string, bool is_fetch)
|
|
44
44
|
|
45
45
|
spec->push = !is_fetch;
|
46
46
|
if (git_vector_insert(vector, spec) < 0) {
|
47
|
-
|
47
|
+
git_refspec__free(spec);
|
48
48
|
git__free(spec);
|
49
49
|
return -1;
|
50
50
|
}
|
@@ -67,7 +67,7 @@ static int download_tags_value(git_remote *remote, git_config *cfg)
|
|
67
67
|
return -1;
|
68
68
|
|
69
69
|
error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
|
70
|
-
|
70
|
+
git_buf_free(&buf);
|
71
71
|
|
72
72
|
if (!error && ce && ce->value) {
|
73
73
|
if (!strcmp(ce->value, "--no-tags"))
|
@@ -117,7 +117,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
|
|
117
117
|
return error;
|
118
118
|
}
|
119
119
|
|
120
|
-
|
120
|
+
git_refspec__free(&spec);
|
121
121
|
|
122
122
|
if ((error = git_buf_printf(&var, fmt, name)) < 0)
|
123
123
|
return error;
|
@@ -132,7 +132,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
|
|
132
132
|
}
|
133
133
|
|
134
134
|
cleanup:
|
135
|
-
|
135
|
+
git_buf_free(&var);
|
136
136
|
return 0;
|
137
137
|
}
|
138
138
|
|
@@ -255,7 +255,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
|
|
255
255
|
remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO;
|
256
256
|
|
257
257
|
|
258
|
-
|
258
|
+
git_buf_free(&var);
|
259
259
|
|
260
260
|
*out = remote;
|
261
261
|
error = 0;
|
@@ -265,8 +265,8 @@ on_error:
|
|
265
265
|
git_remote_free(remote);
|
266
266
|
|
267
267
|
git_config_free(config_ro);
|
268
|
-
|
269
|
-
|
268
|
+
git_buf_free(&canonical_url);
|
269
|
+
git_buf_free(&var);
|
270
270
|
return error;
|
271
271
|
}
|
272
272
|
|
@@ -302,7 +302,7 @@ int git_remote_create(git_remote **out, git_repository *repo, const char *name,
|
|
302
302
|
return -1;
|
303
303
|
|
304
304
|
error = git_remote_create_with_fetchspec(out, repo, name, url, git_buf_cstr(&buf));
|
305
|
-
|
305
|
+
git_buf_free(&buf);
|
306
306
|
|
307
307
|
return error;
|
308
308
|
}
|
@@ -428,7 +428,7 @@ static int get_optional_config(
|
|
428
428
|
|
429
429
|
int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
430
430
|
{
|
431
|
-
git_remote *remote;
|
431
|
+
git_remote *remote = NULL;
|
432
432
|
git_buf buf = GIT_BUF_INIT;
|
433
433
|
const char *val;
|
434
434
|
int error = 0;
|
@@ -510,7 +510,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
510
510
|
if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0)
|
511
511
|
goto cleanup;
|
512
512
|
|
513
|
-
if (download_tags_value(remote, config) < 0)
|
513
|
+
if ((error = download_tags_value(remote, config)) < 0)
|
514
514
|
goto cleanup;
|
515
515
|
|
516
516
|
if ((error = lookup_remote_prune_config(remote, config, name)) < 0)
|
@@ -524,7 +524,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
|
|
524
524
|
|
525
525
|
cleanup:
|
526
526
|
git_config_free(config);
|
527
|
-
|
527
|
+
git_buf_free(&buf);
|
528
528
|
|
529
529
|
if (error < 0)
|
530
530
|
git_remote_free(remote);
|
@@ -552,7 +552,7 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
|
|
552
552
|
}
|
553
553
|
}
|
554
554
|
|
555
|
-
|
555
|
+
git_buf_free(&buf);
|
556
556
|
return error;
|
557
557
|
}
|
558
558
|
|
@@ -601,8 +601,8 @@ static int set_url(git_repository *repo, const char *remote, const char *pattern
|
|
601
601
|
}
|
602
602
|
|
603
603
|
cleanup:
|
604
|
-
|
605
|
-
|
604
|
+
git_buf_free(&canonical_url);
|
605
|
+
git_buf_free(&buf);
|
606
606
|
|
607
607
|
return error;
|
608
608
|
}
|
@@ -761,7 +761,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
|
|
761
761
|
return error;
|
762
762
|
|
763
763
|
error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
|
764
|
-
|
764
|
+
git_buf_free(&buf);
|
765
765
|
|
766
766
|
if (error < 0)
|
767
767
|
return error;
|
@@ -826,7 +826,7 @@ static void free_refspecs(git_vector *vec)
|
|
826
826
|
git_refspec *spec;
|
827
827
|
|
828
828
|
git_vector_foreach(vec, i, spec) {
|
829
|
-
|
829
|
+
git_refspec__free(spec);
|
830
830
|
git__free(spec);
|
831
831
|
}
|
832
832
|
|
@@ -985,7 +985,7 @@ int git_remote_fetch(
|
|
985
985
|
|
986
986
|
/* Create "remote/foo" branches for all remote branches */
|
987
987
|
error = git_remote_update_tips(remote, cbs, update_fetchhead, tagopt, git_buf_cstr(&reflog_msg_buf));
|
988
|
-
|
988
|
+
git_buf_free(&reflog_msg_buf);
|
989
989
|
if (error < 0)
|
990
990
|
return error;
|
991
991
|
|
@@ -1050,8 +1050,8 @@ static int ref_to_update(int *update, git_buf *remote_name, git_remote *remote,
|
|
1050
1050
|
*update = 1;
|
1051
1051
|
}
|
1052
1052
|
|
1053
|
-
|
1054
|
-
|
1053
|
+
git_buf_free(&upstream_remote);
|
1054
|
+
git_buf_free(&upstream_name);
|
1055
1055
|
return error;
|
1056
1056
|
}
|
1057
1057
|
|
@@ -1084,7 +1084,7 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
|
|
1084
1084
|
error = remote_head_for_fetchspec_src(out, update_heads, git_buf_cstr(&remote_name));
|
1085
1085
|
|
1086
1086
|
cleanup:
|
1087
|
-
|
1087
|
+
git_buf_free(&remote_name);
|
1088
1088
|
git_reference_free(resolved_ref);
|
1089
1089
|
git_config_free(config);
|
1090
1090
|
return error;
|
@@ -1234,8 +1234,8 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
|
|
1234
1234
|
goto cleanup;
|
1235
1235
|
|
1236
1236
|
key.name = (char *) git_buf_cstr(&buf);
|
1237
|
-
error =
|
1238
|
-
|
1237
|
+
error = git_vector_bsearch(&pos, &remote_refs, &key);
|
1238
|
+
git_buf_free(&buf);
|
1239
1239
|
|
1240
1240
|
if (error < 0 && error != GIT_ENOTFOUND)
|
1241
1241
|
goto cleanup;
|
@@ -1416,14 +1416,14 @@ static int update_tips_for_spec(
|
|
1416
1416
|
goto on_error;
|
1417
1417
|
|
1418
1418
|
git_vector_free(&update_heads);
|
1419
|
-
|
1420
|
-
|
1419
|
+
git_refspec__free(&tagspec);
|
1420
|
+
git_buf_free(&refname);
|
1421
1421
|
return 0;
|
1422
1422
|
|
1423
1423
|
on_error:
|
1424
1424
|
git_vector_free(&update_heads);
|
1425
|
-
|
1426
|
-
|
1425
|
+
git_refspec__free(&tagspec);
|
1426
|
+
git_buf_free(&refname);
|
1427
1427
|
return -1;
|
1428
1428
|
|
1429
1429
|
}
|
@@ -1537,7 +1537,7 @@ static int opportunistic_updates(const git_remote *remote, const git_remote_call
|
|
1537
1537
|
error = 0;
|
1538
1538
|
|
1539
1539
|
cleanup:
|
1540
|
-
|
1540
|
+
git_buf_free(&refname);
|
1541
1541
|
return error;
|
1542
1542
|
}
|
1543
1543
|
|
@@ -1550,7 +1550,7 @@ static int truncate_fetch_head(const char *gitdir)
|
|
1550
1550
|
return error;
|
1551
1551
|
|
1552
1552
|
error = git_futils_truncate(path.ptr, GIT_REFS_FILE_MODE);
|
1553
|
-
|
1553
|
+
git_buf_free(&path);
|
1554
1554
|
|
1555
1555
|
return error;
|
1556
1556
|
}
|
@@ -1607,7 +1607,7 @@ int git_remote_update_tips(
|
|
1607
1607
|
|
1608
1608
|
out:
|
1609
1609
|
git_vector_free(&refs);
|
1610
|
-
|
1610
|
+
git_refspec__free(&tagspec);
|
1611
1611
|
return error;
|
1612
1612
|
}
|
1613
1613
|
|
@@ -1759,7 +1759,7 @@ int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_
|
|
1759
1759
|
error = -1;
|
1760
1760
|
}
|
1761
1761
|
|
1762
|
-
|
1762
|
+
git_buf_free(&var);
|
1763
1763
|
return error;
|
1764
1764
|
}
|
1765
1765
|
|
@@ -1790,8 +1790,8 @@ static int rename_remote_config_section(
|
|
1790
1790
|
new_name ? git_buf_cstr(&new_section_name) : NULL);
|
1791
1791
|
|
1792
1792
|
cleanup:
|
1793
|
-
|
1794
|
-
|
1793
|
+
git_buf_free(&old_section_name);
|
1794
|
+
git_buf_free(&new_section_name);
|
1795
1795
|
|
1796
1796
|
return error;
|
1797
1797
|
}
|
@@ -1887,10 +1887,10 @@ static int rename_one_remote_reference(
|
|
1887
1887
|
cleanup:
|
1888
1888
|
git_reference_free(reference_in);
|
1889
1889
|
git_reference_free(ref);
|
1890
|
-
|
1891
|
-
|
1892
|
-
|
1893
|
-
|
1890
|
+
git_buf_free(&namespace);
|
1891
|
+
git_buf_free(&old_namespace);
|
1892
|
+
git_buf_free(&new_name);
|
1893
|
+
git_buf_free(&log_message);
|
1894
1894
|
return error;
|
1895
1895
|
}
|
1896
1896
|
|
@@ -1908,7 +1908,7 @@ static int rename_remote_references(
|
|
1908
1908
|
return error;
|
1909
1909
|
|
1910
1910
|
error = git_reference_iterator_glob_new(&iter, repo, git_buf_cstr(&buf));
|
1911
|
-
|
1911
|
+
git_buf_free(&buf);
|
1912
1912
|
|
1913
1913
|
if (error < 0)
|
1914
1914
|
return error;
|
@@ -1976,9 +1976,9 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
|
|
1976
1976
|
break;
|
1977
1977
|
}
|
1978
1978
|
|
1979
|
-
|
1980
|
-
|
1981
|
-
|
1979
|
+
git_buf_free(&base);
|
1980
|
+
git_buf_free(&var);
|
1981
|
+
git_buf_free(&val);
|
1982
1982
|
|
1983
1983
|
if (error < 0) {
|
1984
1984
|
char *str;
|
@@ -2044,8 +2044,8 @@ int git_remote_is_valid_name(
|
|
2044
2044
|
git_buf_printf(&buf, "refs/heads/test:refs/remotes/%s/test", remote_name);
|
2045
2045
|
error = git_refspec__parse(&refspec, git_buf_cstr(&buf), true);
|
2046
2046
|
|
2047
|
-
|
2048
|
-
|
2047
|
+
git_buf_free(&buf);
|
2048
|
+
git_refspec__free(&refspec);
|
2049
2049
|
|
2050
2050
|
giterr_clear();
|
2051
2051
|
return error == 0;
|
@@ -2219,7 +2219,7 @@ static int remove_branch_config_related_entries(
|
|
2219
2219
|
if (error == GIT_ITEROVER)
|
2220
2220
|
error = 0;
|
2221
2221
|
|
2222
|
-
|
2222
|
+
git_buf_free(&buf);
|
2223
2223
|
git_config_iterator_free(iter);
|
2224
2224
|
return error;
|
2225
2225
|
}
|