rugged 1.0.1 → 1.1.0
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.
- 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
@@ -229,8 +229,10 @@ int git_cherrypick_options_init(
|
|
229
229
|
return 0;
|
230
230
|
}
|
231
231
|
|
232
|
+
#ifndef GIT_DEPRECATE_HARD
|
232
233
|
int git_cherrypick_init_options(
|
233
234
|
git_cherrypick_options *opts, unsigned int version)
|
234
235
|
{
|
235
236
|
return git_cherrypick_options_init(opts, version);
|
236
237
|
}
|
238
|
+
#endif
|
data/vendor/libgit2/src/clone.c
CHANGED
@@ -137,6 +137,80 @@ static int update_head_to_new_branch(
|
|
137
137
|
return error;
|
138
138
|
}
|
139
139
|
|
140
|
+
static int update_head_to_default(git_repository *repo)
|
141
|
+
{
|
142
|
+
git_buf initialbranch = GIT_BUF_INIT;
|
143
|
+
const char *branch_name;
|
144
|
+
int error = 0;
|
145
|
+
|
146
|
+
if ((error = git_repository_initialbranch(&initialbranch, repo)) < 0)
|
147
|
+
goto done;
|
148
|
+
|
149
|
+
if (git__prefixcmp(initialbranch.ptr, GIT_REFS_HEADS_DIR) != 0) {
|
150
|
+
git_error_set(GIT_ERROR_INVALID, "invalid initial branch '%s'", initialbranch.ptr);
|
151
|
+
error = -1;
|
152
|
+
goto done;
|
153
|
+
}
|
154
|
+
|
155
|
+
branch_name = initialbranch.ptr + strlen(GIT_REFS_HEADS_DIR);
|
156
|
+
|
157
|
+
error = setup_tracking_config(repo, branch_name, GIT_REMOTE_ORIGIN,
|
158
|
+
initialbranch.ptr);
|
159
|
+
|
160
|
+
done:
|
161
|
+
git_buf_dispose(&initialbranch);
|
162
|
+
return error;
|
163
|
+
}
|
164
|
+
|
165
|
+
static int update_remote_head(
|
166
|
+
git_repository *repo,
|
167
|
+
git_remote *remote,
|
168
|
+
git_buf *target,
|
169
|
+
const char *reflog_message)
|
170
|
+
{
|
171
|
+
git_refspec *refspec;
|
172
|
+
git_reference *remote_head = NULL;
|
173
|
+
git_buf remote_head_name = GIT_BUF_INIT;
|
174
|
+
git_buf remote_branch_name = GIT_BUF_INIT;
|
175
|
+
int error;
|
176
|
+
|
177
|
+
/* Determine the remote tracking ref name from the local branch */
|
178
|
+
refspec = git_remote__matching_refspec(remote, git_buf_cstr(target));
|
179
|
+
|
180
|
+
if (refspec == NULL) {
|
181
|
+
git_error_set(GIT_ERROR_NET, "the remote's default branch does not fit the refspec configuration");
|
182
|
+
error = GIT_EINVALIDSPEC;
|
183
|
+
goto cleanup;
|
184
|
+
}
|
185
|
+
|
186
|
+
if ((error = git_refspec_transform(
|
187
|
+
&remote_branch_name,
|
188
|
+
refspec,
|
189
|
+
git_buf_cstr(target))) < 0)
|
190
|
+
goto cleanup;
|
191
|
+
|
192
|
+
if ((error = git_buf_printf(&remote_head_name,
|
193
|
+
"%s%s/%s",
|
194
|
+
GIT_REFS_REMOTES_DIR,
|
195
|
+
git_remote_name(remote),
|
196
|
+
GIT_HEAD_FILE)) < 0)
|
197
|
+
goto cleanup;
|
198
|
+
|
199
|
+
error = git_reference_symbolic_create(
|
200
|
+
&remote_head,
|
201
|
+
repo,
|
202
|
+
git_buf_cstr(&remote_head_name),
|
203
|
+
git_buf_cstr(&remote_branch_name),
|
204
|
+
true,
|
205
|
+
reflog_message);
|
206
|
+
|
207
|
+
cleanup:
|
208
|
+
git_reference_free(remote_head);
|
209
|
+
git_buf_dispose(&remote_branch_name);
|
210
|
+
git_buf_dispose(&remote_head_name);
|
211
|
+
return error;
|
212
|
+
}
|
213
|
+
|
140
214
|
static int update_head_to_remote(
|
141
215
|
git_repository *repo,
|
142
216
|
git_remote *remote,
|
@@ -144,10 +218,8 @@ static int update_head_to_remote(
|
|
144
218
|
{
|
145
219
|
int error = 0;
|
146
220
|
size_t refs_len;
|
147
|
-
git_refspec *refspec;
|
148
221
|
const git_remote_head *remote_head, **refs;
|
149
222
|
const git_oid *remote_head_id;
|
150
|
-
git_buf remote_master_name = GIT_BUF_INIT;
|
151
223
|
git_buf branch = GIT_BUF_INIT;
|
152
224
|
|
153
225
|
if ((error = git_remote_ls(&refs, &refs_len, remote)) < 0)
|
@@ -155,8 +227,7 @@ static int update_head_to_remote(
|
|
155
227
|
|
156
228
|
/* We cloned an empty repository or one with an unborn HEAD */
|
157
229
|
if (refs_len == 0 || strcmp(refs[0]->name, GIT_HEAD_FILE))
|
158
|
-
return
|
159
|
-
repo, "master", GIT_REMOTE_ORIGIN, GIT_REFS_HEADS_MASTER_FILE);
|
230
|
+
return update_head_to_default(repo);
|
160
231
|
|
161
232
|
/* We know we have HEAD, let's see where it points */
|
162
233
|
remote_head = refs[0];
|
@@ -171,19 +242,7 @@ static int update_head_to_remote(
|
|
171
242
|
goto cleanup;
|
172
243
|
}
|
173
244
|
|
174
|
-
|
175
|
-
|
176
|
-
if (refspec == NULL) {
|
177
|
-
git_error_set(GIT_ERROR_NET, "the remote's default branch does not fit the refspec configuration");
|
178
|
-
error = GIT_EINVALIDSPEC;
|
179
|
-
goto cleanup;
|
180
|
-
}
|
181
|
-
|
182
|
-
/* Determine the remote tracking reference name from the local master */
|
183
|
-
if ((error = git_refspec_transform(
|
184
|
-
&remote_master_name,
|
185
|
-
refspec,
|
186
|
-
git_buf_cstr(&branch))) < 0)
|
245
|
+
if ((error = update_remote_head(repo, remote, &branch, reflog_message)) < 0)
|
187
246
|
goto cleanup;
|
188
247
|
|
189
248
|
error = update_head_to_new_branch(
|
@@ -193,7 +252,6 @@ static int update_head_to_remote(
|
|
193
252
|
reflog_message);
|
194
253
|
|
195
254
|
cleanup:
|
196
|
-
git_buf_dispose(&remote_master_name);
|
197
255
|
git_buf_dispose(&branch);
|
198
256
|
|
199
257
|
return error;
|
@@ -479,10 +537,12 @@ int git_clone_options_init(git_clone_options *opts, unsigned int version)
|
|
479
537
|
return 0;
|
480
538
|
}
|
481
539
|
|
540
|
+
#ifndef GIT_DEPRECATE_HARD
|
482
541
|
int git_clone_init_options(git_clone_options *opts, unsigned int version)
|
483
542
|
{
|
484
543
|
return git_clone_options_init(opts, version);
|
485
544
|
}
|
545
|
+
#endif
|
486
546
|
|
487
547
|
static bool can_link(const char *src, const char *dst, int link)
|
488
548
|
{
|
data/vendor/libgit2/src/common.h
CHANGED
data/vendor/libgit2/src/config.c
CHANGED
@@ -1000,7 +1000,7 @@ static int multivar_iter_next(git_config_entry **entry, git_config_iterator *_it
|
|
1000
1000
|
return error;
|
1001
1001
|
}
|
1002
1002
|
|
1003
|
-
void multivar_iter_free(git_config_iterator *_iter)
|
1003
|
+
static void multivar_iter_free(git_config_iterator *_iter)
|
1004
1004
|
{
|
1005
1005
|
multivar_iter *iter = (multivar_iter *) _iter;
|
1006
1006
|
|
@@ -1227,9 +1227,6 @@ int git_config_lookup_map_value(
|
|
1227
1227
|
{
|
1228
1228
|
size_t i;
|
1229
1229
|
|
1230
|
-
if (!value)
|
1231
|
-
goto fail_parse;
|
1232
|
-
|
1233
1230
|
for (i = 0; i < map_n; ++i) {
|
1234
1231
|
const git_configmap *m = maps + i;
|
1235
1232
|
|
@@ -1238,7 +1235,7 @@ int git_config_lookup_map_value(
|
|
1238
1235
|
case GIT_CONFIGMAP_TRUE: {
|
1239
1236
|
int bool_val;
|
1240
1237
|
|
1241
|
-
if (
|
1238
|
+
if (git_config_parse_bool(&bool_val, value) == 0 &&
|
1242
1239
|
bool_val == (int)m->type) {
|
1243
1240
|
*out = m->map_value;
|
1244
1241
|
return 0;
|
@@ -1252,7 +1249,7 @@ int git_config_lookup_map_value(
|
|
1252
1249
|
break;
|
1253
1250
|
|
1254
1251
|
case GIT_CONFIGMAP_STRING:
|
1255
|
-
if (strcasecmp(value, m->str_match) == 0) {
|
1252
|
+
if (value && strcasecmp(value, m->str_match) == 0) {
|
1256
1253
|
*out = m->map_value;
|
1257
1254
|
return 0;
|
1258
1255
|
}
|
@@ -1260,7 +1257,6 @@ int git_config_lookup_map_value(
|
|
1260
1257
|
}
|
1261
1258
|
}
|
1262
1259
|
|
1263
|
-
fail_parse:
|
1264
1260
|
git_error_set(GIT_ERROR_CONFIG, "failed to map '%s'", value);
|
1265
1261
|
return -1;
|
1266
1262
|
}
|
@@ -11,9 +11,13 @@ typedef struct config_entry_list {
|
|
11
11
|
struct config_entry_list *next;
|
12
12
|
struct config_entry_list *last;
|
13
13
|
git_config_entry *entry;
|
14
|
-
bool first;
|
15
14
|
} config_entry_list;
|
16
15
|
|
16
|
+
typedef struct {
|
17
|
+
git_config_entry *entry;
|
18
|
+
bool multivar;
|
19
|
+
} config_entry_map_head;
|
20
|
+
|
17
21
|
typedef struct config_entries_iterator {
|
18
22
|
git_config_iterator parent;
|
19
23
|
git_config_entries *entries;
|
@@ -102,14 +106,16 @@ void git_config_entries_incref(git_config_entries *entries)
|
|
102
106
|
static void config_entries_free(git_config_entries *entries)
|
103
107
|
{
|
104
108
|
config_entry_list *list = NULL, *next;
|
109
|
+
config_entry_map_head *head;
|
105
110
|
|
111
|
+
git_strmap_foreach_value(entries->map, head,
|
112
|
+
git__free((char *) head->entry->name); git__free(head)
|
113
|
+
);
|
106
114
|
git_strmap_free(entries->map);
|
107
115
|
|
108
116
|
list = entries->list;
|
109
117
|
while (list != NULL) {
|
110
118
|
next = list->next;
|
111
|
-
if (list->first)
|
112
|
-
git__free((char *) list->entry->name);
|
113
119
|
git__free((char *) list->entry->value);
|
114
120
|
git__free(list->entry);
|
115
121
|
git__free(list);
|
@@ -127,40 +133,42 @@ void git_config_entries_free(git_config_entries *entries)
|
|
127
133
|
|
128
134
|
int git_config_entries_append(git_config_entries *entries, git_config_entry *entry)
|
129
135
|
{
|
130
|
-
config_entry_list *
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
*/
|
142
|
-
if ((existing = git_strmap_get(entries->map, entry->name)) != NULL) {
|
136
|
+
config_entry_list *list_head;
|
137
|
+
config_entry_map_head *map_head;
|
138
|
+
|
139
|
+
if ((map_head = git_strmap_get(entries->map, entry->name)) != NULL) {
|
140
|
+
map_head->multivar = true;
|
141
|
+
/*
|
142
|
+
* This is a micro-optimization for configuration files
|
143
|
+
* with a lot of same keys. As for multivars the entry's
|
144
|
+
* key will be the same for all entries, we can just free
|
145
|
+
* all except the first entry's name and just re-use it.
|
146
|
+
*/
|
143
147
|
git__free((char *) entry->name);
|
144
|
-
entry->name =
|
148
|
+
entry->name = map_head->entry->name;
|
145
149
|
} else {
|
146
|
-
|
150
|
+
map_head = git__calloc(1, sizeof(*map_head));
|
151
|
+
if ((git_strmap_set(entries->map, entry->name, map_head)) < 0)
|
152
|
+
return -1;
|
147
153
|
}
|
154
|
+
map_head->entry = entry;
|
155
|
+
|
156
|
+
list_head = git__calloc(1, sizeof(config_entry_list));
|
157
|
+
GIT_ERROR_CHECK_ALLOC(list_head);
|
158
|
+
list_head->entry = entry;
|
148
159
|
|
149
160
|
if (entries->list)
|
150
|
-
entries->list->last->next =
|
161
|
+
entries->list->last->next = list_head;
|
151
162
|
else
|
152
|
-
entries->list =
|
153
|
-
entries->list->last =
|
154
|
-
|
155
|
-
if (git_strmap_set(entries->map, entry->name, head) < 0)
|
156
|
-
return -1;
|
163
|
+
entries->list = list_head;
|
164
|
+
entries->list->last = list_head;
|
157
165
|
|
158
166
|
return 0;
|
159
167
|
}
|
160
168
|
|
161
169
|
int git_config_entries_get(git_config_entry **out, git_config_entries *entries, const char *key)
|
162
170
|
{
|
163
|
-
|
171
|
+
config_entry_map_head *entry;
|
164
172
|
if ((entry = git_strmap_get(entries->map, key)) == NULL)
|
165
173
|
return GIT_ENOTFOUND;
|
166
174
|
*out = entry->entry;
|
@@ -169,12 +177,12 @@ int git_config_entries_get(git_config_entry **out, git_config_entries *entries,
|
|
169
177
|
|
170
178
|
int git_config_entries_get_unique(git_config_entry **out, git_config_entries *entries, const char *key)
|
171
179
|
{
|
172
|
-
|
180
|
+
config_entry_map_head *entry;
|
173
181
|
|
174
182
|
if ((entry = git_strmap_get(entries->map, key)) == NULL)
|
175
183
|
return GIT_ENOTFOUND;
|
176
184
|
|
177
|
-
if (
|
185
|
+
if (entry->multivar) {
|
178
186
|
git_error_set(GIT_ERROR_CONFIG, "entry is not unique due to being a multivar");
|
179
187
|
return -1;
|
180
188
|
}
|
@@ -451,7 +451,7 @@ static int parse_variable(git_config_parser *reader, char **var_name, char **var
|
|
451
451
|
git_buf_attach(&multi_value, value, 0);
|
452
452
|
value = NULL;
|
453
453
|
|
454
|
-
if (parse_multiline_variable(reader, &multi_value, quote_count) < 0 ||
|
454
|
+
if (parse_multiline_variable(reader, &multi_value, quote_count % 2) < 0 ||
|
455
455
|
git_buf_oom(&multi_value)) {
|
456
456
|
error = -1;
|
457
457
|
git_buf_dispose(&multi_value);
|
@@ -685,7 +685,7 @@ int git_describe_commit(
|
|
685
685
|
get_name, &data)) < 0)
|
686
686
|
goto cleanup;
|
687
687
|
|
688
|
-
if (git_oidmap_size(data.names) == 0 && !
|
688
|
+
if (git_oidmap_size(data.names) == 0 && !normalized.show_commit_oid_as_fallback) {
|
689
689
|
git_error_set(GIT_ERROR_DESCRIBE, "cannot describe - "
|
690
690
|
"no reference found, cannot describe anything.");
|
691
691
|
error = -1;
|
@@ -876,10 +876,12 @@ int git_describe_options_init(git_describe_options *opts, unsigned int version)
|
|
876
876
|
return 0;
|
877
877
|
}
|
878
878
|
|
879
|
+
#ifndef GIT_DEPRECATE_HARD
|
879
880
|
int git_describe_init_options(git_describe_options *opts, unsigned int version)
|
880
881
|
{
|
881
882
|
return git_describe_options_init(opts, version);
|
882
883
|
}
|
884
|
+
#endif
|
883
885
|
|
884
886
|
int git_describe_format_options_init(git_describe_format_options *opts, unsigned int version)
|
885
887
|
{
|
@@ -888,7 +890,9 @@ int git_describe_format_options_init(git_describe_format_options *opts, unsigned
|
|
888
890
|
return 0;
|
889
891
|
}
|
890
892
|
|
893
|
+
#ifndef GIT_DEPRECATE_HARD
|
891
894
|
int git_describe_init_format_options(git_describe_format_options *opts, unsigned int version)
|
892
895
|
{
|
893
896
|
return git_describe_format_options_init(opts, version);
|
894
897
|
}
|
898
|
+
#endif
|
data/vendor/libgit2/src/diff.c
CHANGED
@@ -32,11 +32,6 @@ GIT_INLINE(const char *) diff_delta__path(const git_diff_delta *delta)
|
|
32
32
|
return str;
|
33
33
|
}
|
34
34
|
|
35
|
-
const char *git_diff_delta__path(const git_diff_delta *delta)
|
36
|
-
{
|
37
|
-
return diff_delta__path(delta);
|
38
|
-
}
|
39
|
-
|
40
35
|
int git_diff_delta__cmp(const void *a, const void *b)
|
41
36
|
{
|
42
37
|
const git_diff_delta *da = a, *db = b;
|
@@ -155,7 +150,7 @@ int git_diff_foreach(
|
|
155
150
|
return error;
|
156
151
|
}
|
157
152
|
|
158
|
-
int
|
153
|
+
static int diff_format_email_append_header_tobuf(
|
159
154
|
git_buf *out,
|
160
155
|
const git_oid *id,
|
161
156
|
const git_signature *author,
|
@@ -212,7 +207,7 @@ int git_diff_format_email__append_header_tobuf(
|
|
212
207
|
return error;
|
213
208
|
}
|
214
209
|
|
215
|
-
int
|
210
|
+
static int diff_format_email_append_patches_tobuf(
|
216
211
|
git_buf *out,
|
217
212
|
git_diff *diff)
|
218
213
|
{
|
@@ -292,7 +287,7 @@ int git_diff_format_email(
|
|
292
287
|
strncpy(summary, opts->summary, offset);
|
293
288
|
}
|
294
289
|
|
295
|
-
error =
|
290
|
+
error = diff_format_email_append_header_tobuf(out,
|
296
291
|
opts->id, opts->author, summary == NULL ? opts->summary : summary,
|
297
292
|
opts->body, opts->patch_no, opts->total_patches, ignore_marker);
|
298
293
|
|
@@ -305,7 +300,7 @@ int git_diff_format_email(
|
|
305
300
|
(error = git_diff_get_stats(&stats, diff)) < 0 ||
|
306
301
|
(error = git_diff_stats_to_buf(out, stats, format_flags, 0)) < 0 ||
|
307
302
|
(error = git_buf_putc(out, '\n')) < 0 ||
|
308
|
-
(error =
|
303
|
+
(error = diff_format_email_append_patches_tobuf(out, diff)) < 0)
|
309
304
|
goto on_error;
|
310
305
|
|
311
306
|
error = git_buf_puts(out, "--\nlibgit2 " LIBGIT2_VERSION "\n\n");
|
@@ -357,10 +352,12 @@ int git_diff_options_init(git_diff_options *opts, unsigned int version)
|
|
357
352
|
return 0;
|
358
353
|
}
|
359
354
|
|
355
|
+
#ifndef GIT_DEPRECATE_HARD
|
360
356
|
int git_diff_init_options(git_diff_options *opts, unsigned int version)
|
361
357
|
{
|
362
358
|
return git_diff_options_init(opts, version);
|
363
359
|
}
|
360
|
+
#endif
|
364
361
|
|
365
362
|
int git_diff_find_options_init(
|
366
363
|
git_diff_find_options *opts, unsigned int version)
|
@@ -370,11 +367,13 @@ int git_diff_find_options_init(
|
|
370
367
|
return 0;
|
371
368
|
}
|
372
369
|
|
370
|
+
#ifndef GIT_DEPRECATE_HARD
|
373
371
|
int git_diff_find_init_options(
|
374
372
|
git_diff_find_options *opts, unsigned int version)
|
375
373
|
{
|
376
374
|
return git_diff_find_options_init(opts, version);
|
377
375
|
}
|
376
|
+
#endif
|
378
377
|
|
379
378
|
int git_diff_format_email_options_init(
|
380
379
|
git_diff_format_email_options *opts, unsigned int version)
|
@@ -385,11 +384,13 @@ int git_diff_format_email_options_init(
|
|
385
384
|
return 0;
|
386
385
|
}
|
387
386
|
|
387
|
+
#ifndef GIT_DEPRECATE_HARD
|
388
388
|
int git_diff_format_email_init_options(
|
389
389
|
git_diff_format_email_options *opts, unsigned int version)
|
390
390
|
{
|
391
391
|
return git_diff_format_email_options_init(opts, version);
|
392
392
|
}
|
393
|
+
#endif
|
393
394
|
|
394
395
|
static int flush_hunk(git_oid *result, git_hash_ctx *ctx)
|
395
396
|
{
|
@@ -426,7 +427,7 @@ static void strip_spaces(git_buf *buf)
|
|
426
427
|
git_buf_truncate(buf, len);
|
427
428
|
}
|
428
429
|
|
429
|
-
int
|
430
|
+
static int diff_patchid_print_callback_to_buf(
|
430
431
|
const git_diff_delta *delta,
|
431
432
|
const git_diff_hunk *hunk,
|
432
433
|
const git_diff_line *line,
|
@@ -485,7 +486,7 @@ int git_diff_patchid(git_oid *out, git_diff *diff, git_diff_patchid_options *opt
|
|
485
486
|
|
486
487
|
if ((error = git_diff_print(diff,
|
487
488
|
GIT_DIFF_FORMAT_PATCH_ID,
|
488
|
-
|
489
|
+
diff_patchid_print_callback_to_buf,
|
489
490
|
&args)) < 0)
|
490
491
|
goto out;
|
491
492
|
|